From 20f6603753d7abab673b0cfb092569dc837f156d Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Fri, 17 Jan 2020 21:59:34 -0800 Subject: Updated to 5.4.13 --- ...ctl-and-CONFIG-to-disallow-unprivileged-C.patch | 132 ++++++++++ ...IG-to-disallow-unprivileged-CLONE_NEWUSER.patch | 131 ---------- ...vres-add-a-helper-function-for-ioremap_uc.patch | 6 +- ...d-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch | 6 +- ...Do-not-disable-interrupt-twice-on-suspend.patch | 99 -------- ...PCI-pciehp-Prevent-deadlock-on-disconnect.patch | 272 +++++++++++++++++++++ ...s2idle-Rework-ACPI-events-synchronization.patch | 78 ++++++ ...PCI-pciehp-Prevent-deadlock-on-disconnect.patch | 272 --------------------- ...s2idle-Rework-ACPI-events-synchronization.patch | 78 ------ ...cie-restore-support-for-Killer-Qu-C0-NICs.patch | 36 +++ ...ve-AUD_FREQ_CNTRL-state-at-audio-domain-s.patch | 87 +++++++ ...cie-restore-support-for-Killer-Qu-C0-NICs.patch | 36 --- ...x-audio-power-up-sequence-for-gen10-displ.patch | 57 +++++ ..._FREQ_CNTRL-state-at-audio-domain-suspend.patch | 86 ------- ...audio-power-up-sequence-for-gen10-display.patch | 56 ----- ...tend-audio-CDCLK-2-BCLK-constraint-to-mor.patch | 41 ++++ ...mit-audio-CDCLK-2-BCLK-constraint-back-to.patch | 64 +++++ ...-CDCLK-2BCLK-constraint-to-more-platforms.patch | 40 --- ...o-CDCLK-2BCLK-constraint-back-to-GLK-only.patch | 63 ----- ...risepoint-Add-missing-Interrupt-Status-re.patch | 35 +++ ...-iwlwifi-mvm-fix-scan-config-command-size.patch | 48 ++++ ...-missing-Interrupt-Status-register-offset.patch | 34 --- ...-iwlwifi-mvm-fix-scan-config-command-size.patch | 48 ---- ...ert-e1000e-Make-watchdog-use-delayed-work.patch | 174 +++++++++++++ ...Add-DC-feature-mask-to-disable-fractional.patch | 80 ++++++ ...ert-e1000e-Make-watchdog-use-delayed-work.patch | 174 ------------- ...-free-ptp-device-pin-descriptors-properly.patch | 50 ++++ PKGBUILD | 136 ++++++----- config | 5 +- 29 files changed, 1232 insertions(+), 1192 deletions(-) create mode 100644 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch delete mode 100644 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch delete mode 100644 0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch create mode 100644 0004-PCI-pciehp-Prevent-deadlock-on-disconnect.patch create mode 100644 0005-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch delete mode 100644 0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch delete mode 100644 0006-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch create mode 100644 0006-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch create mode 100644 0007-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-s.patch delete mode 100644 0007-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch create mode 100644 0008-drm-i915-Fix-audio-power-up-sequence-for-gen10-displ.patch delete mode 100644 0008-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-suspend.patch delete mode 100644 0009-drm-i915-Fix-audio-power-up-sequence-for-gen10-display.patch create mode 100644 0009-drm-i915-extend-audio-CDCLK-2-BCLK-constraint-to-mor.patch create mode 100644 0010-drm-i915-Limit-audio-CDCLK-2-BCLK-constraint-back-to.patch delete mode 100644 0010-drm-i915-extend-audio-CDCLK-2BCLK-constraint-to-more-platforms.patch delete mode 100644 0011-drm-915-Limit-audio-CDCLK-2BCLK-constraint-back-to-GLK-only.patch create mode 100644 0011-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-re.patch create mode 100644 0012-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch delete mode 100644 0012-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-register-offset.patch delete mode 100644 0013-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch create mode 100644 0013-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch create mode 100644 0014-drm-amdgpu-Add-DC-feature-mask-to-disable-fractional.patch delete mode 100644 0014-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch create mode 100644 0015-ptp-free-ptp-device-pin-descriptors-properly.patch diff --git a/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch b/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch new file mode 100644 index 0000000..a0f8524 --- /dev/null +++ b/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch @@ -0,0 +1,132 @@ +From ace933a17f0b2e6e75e5ed330e8c12efae62aa53 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Mon, 16 Sep 2019 04:53:20 +0200 +Subject: [PATCH 01/16] ZEN: Add sysctl and CONFIG to disallow unprivileged + CLONE_NEWUSER + +Our default behavior continues to match the vanilla kernel. +--- + init/Kconfig | 16 ++++++++++++++++ + kernel/fork.c | 15 +++++++++++++++ + kernel/sysctl.c | 12 ++++++++++++ + kernel/user_namespace.c | 7 +++++++ + 4 files changed, 50 insertions(+) + +diff --git a/init/Kconfig b/init/Kconfig +index b4daad2bac23..362f82c5ec07 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1118,6 +1118,22 @@ config USER_NS + + If unsure, say N. + ++config USER_NS_UNPRIVILEGED ++ bool "Allow unprivileged users to create namespaces" ++ default y ++ depends on USER_NS ++ help ++ When disabled, unprivileged users will not be able to create ++ new namespaces. Allowing users to create their own namespaces ++ has been part of several recent local privilege escalation ++ exploits, so if you need user namespaces but are ++ paranoid^Wsecurity-conscious you want to disable this. ++ ++ This setting can be overridden at runtime via the ++ kernel.unprivileged_userns_clone sysctl. ++ ++ If unsure, say Y. ++ + config PID_NS + bool "PID Namespaces" + default y +diff --git a/kernel/fork.c b/kernel/fork.c +index 755d8160e001..ed909f8050b2 100644 +--- a/kernel/fork.c ++++ b/kernel/fork.c +@@ -106,6 +106,11 @@ + + #define CREATE_TRACE_POINTS + #include ++#ifdef CONFIG_USER_NS ++extern int unprivileged_userns_clone; ++#else ++#define unprivileged_userns_clone 0 ++#endif + + /* + * Minimum number of threads to boot the kernel +@@ -1779,6 +1784,10 @@ static __latent_entropy struct task_struct *copy_process( + if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) + return ERR_PTR(-EINVAL); + ++ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) ++ if (!capable(CAP_SYS_ADMIN)) ++ return ERR_PTR(-EPERM); ++ + /* + * Thread groups must share signals as well, and detached threads + * can only be started up within the thread group. +@@ -2836,6 +2845,12 @@ int ksys_unshare(unsigned long unshare_flags) + if (unshare_flags & CLONE_NEWNS) + unshare_flags |= CLONE_FS; + ++ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) { ++ err = -EPERM; ++ if (!capable(CAP_SYS_ADMIN)) ++ goto bad_unshare_out; ++ } ++ + err = check_unshare_flags(unshare_flags); + if (err) + goto bad_unshare_out; +diff --git a/kernel/sysctl.c b/kernel/sysctl.c +index 70665934d53e..9797869ed829 100644 +--- a/kernel/sysctl.c ++++ b/kernel/sysctl.c +@@ -110,6 +110,9 @@ extern int core_uses_pid; + extern char core_pattern[]; + extern unsigned int core_pipe_limit; + #endif ++#ifdef CONFIG_USER_NS ++extern int unprivileged_userns_clone; ++#endif + extern int pid_max; + extern int pid_max_min, pid_max_max; + extern int percpu_pagelist_fraction; +@@ -546,6 +549,15 @@ static struct ctl_table kern_table[] = { + .proc_handler = proc_dointvec, + }, + #endif ++#ifdef CONFIG_USER_NS ++ { ++ .procname = "unprivileged_userns_clone", ++ .data = &unprivileged_userns_clone, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++#endif + #ifdef CONFIG_PROC_SYSCTL + { + .procname = "tainted", +diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c +index 8eadadc478f9..c36ecd19562c 100644 +--- a/kernel/user_namespace.c ++++ b/kernel/user_namespace.c +@@ -21,6 +21,13 @@ + #include + #include + ++/* sysctl */ ++#ifdef CONFIG_USER_NS_UNPRIVILEGED ++int unprivileged_userns_clone = 1; ++#else ++int unprivileged_userns_clone; ++#endif ++ + static struct kmem_cache *user_ns_cachep __read_mostly; + static DEFINE_MUTEX(userns_state_mutex); + +-- +2.25.0 + diff --git a/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch b/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch deleted file mode 100644 index c406c3b..0000000 --- a/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch +++ /dev/null @@ -1,131 +0,0 @@ -From ad4dbce36dd2083de69815f613342257535f6274 Mon Sep 17 00:00:00 2001 -From: "Jan Alexander Steffens (heftig)" -Date: Mon, 16 Sep 2019 04:53:20 +0200 -Subject: ZEN: Add sysctl and CONFIG to disallow unprivileged CLONE_NEWUSER - -Our default behavior continues to match the vanilla kernel. ---- - init/Kconfig | 16 ++++++++++++++++ - kernel/fork.c | 15 +++++++++++++++ - kernel/sysctl.c | 12 ++++++++++++ - kernel/user_namespace.c | 7 +++++++ - 4 files changed, 50 insertions(+) - -diff --git a/init/Kconfig b/init/Kconfig -index b4daad2bac23..362f82c5ec07 100644 ---- a/init/Kconfig -+++ b/init/Kconfig -@@ -1118,6 +1118,22 @@ config USER_NS - - If unsure, say N. - -+config USER_NS_UNPRIVILEGED -+ bool "Allow unprivileged users to create namespaces" -+ default y -+ depends on USER_NS -+ help -+ When disabled, unprivileged users will not be able to create -+ new namespaces. Allowing users to create their own namespaces -+ has been part of several recent local privilege escalation -+ exploits, so if you need user namespaces but are -+ paranoid^Wsecurity-conscious you want to disable this. -+ -+ This setting can be overridden at runtime via the -+ kernel.unprivileged_userns_clone sysctl. -+ -+ If unsure, say Y. -+ - config PID_NS - bool "PID Namespaces" - default y -diff --git a/kernel/fork.c b/kernel/fork.c -index 6cabc124378c..fda4986da9eb 100644 ---- a/kernel/fork.c -+++ b/kernel/fork.c -@@ -106,6 +106,11 @@ - - #define CREATE_TRACE_POINTS - #include -+#ifdef CONFIG_USER_NS -+extern int unprivileged_userns_clone; -+#else -+#define unprivileged_userns_clone 0 -+#endif - - /* - * Minimum number of threads to boot the kernel -@@ -1779,6 +1784,10 @@ static __latent_entropy struct task_struct *copy_process( - if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) - return ERR_PTR(-EINVAL); - -+ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) -+ if (!capable(CAP_SYS_ADMIN)) -+ return ERR_PTR(-EPERM); -+ - /* - * Thread groups must share signals as well, and detached threads - * can only be started up within the thread group. -@@ -2826,6 +2835,12 @@ int ksys_unshare(unsigned long unshare_flags) - if (unshare_flags & CLONE_NEWNS) - unshare_flags |= CLONE_FS; - -+ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) { -+ err = -EPERM; -+ if (!capable(CAP_SYS_ADMIN)) -+ goto bad_unshare_out; -+ } -+ - err = check_unshare_flags(unshare_flags); - if (err) - goto bad_unshare_out; -diff --git a/kernel/sysctl.c b/kernel/sysctl.c -index b6f2f35d0bcf..2e9c273990e8 100644 ---- a/kernel/sysctl.c -+++ b/kernel/sysctl.c -@@ -110,6 +110,9 @@ extern int core_uses_pid; - extern char core_pattern[]; - extern unsigned int core_pipe_limit; - #endif -+#ifdef CONFIG_USER_NS -+extern int unprivileged_userns_clone; -+#endif - extern int pid_max; - extern int pid_max_min, pid_max_max; - extern int percpu_pagelist_fraction; -@@ -546,6 +549,15 @@ static struct ctl_table kern_table[] = { - .proc_handler = proc_dointvec, - }, - #endif -+#ifdef CONFIG_USER_NS -+ { -+ .procname = "unprivileged_userns_clone", -+ .data = &unprivileged_userns_clone, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, -+#endif - #ifdef CONFIG_PROC_SYSCTL - { - .procname = "tainted", -diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c -index 8eadadc478f9..c36ecd19562c 100644 ---- a/kernel/user_namespace.c -+++ b/kernel/user_namespace.c -@@ -21,6 +21,13 @@ - #include - #include - -+/* sysctl */ -+#ifdef CONFIG_USER_NS_UNPRIVILEGED -+int unprivileged_userns_clone = 1; -+#else -+int unprivileged_userns_clone; -+#endif -+ - static struct kmem_cache *user_ns_cachep __read_mostly; - static DEFINE_MUTEX(userns_state_mutex); - --- -cgit v1.2.1-1-g437b - diff --git a/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch b/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch index 89450ae..3f0667d 100644 --- a/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch +++ b/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch @@ -1,7 +1,7 @@ -From 5925138606a245d43d8a6db47b754cea6f6049ae Mon Sep 17 00:00:00 2001 +From 78b64515af95e12dac806fa630ae4499e9527100 Mon Sep 17 00:00:00 2001 From: Tuowen Zhao Date: Wed, 16 Oct 2019 15:06:28 -0600 -Subject: lib: devres: add a helper function for ioremap_uc +Subject: [PATCH 02/16] lib: devres: add a helper function for ioremap_uc Implement a resource managed strongly uncachable ioremap function. @@ -75,5 +75,5 @@ index 6a0e9bd6524a..17624d35e82d 100644 * devm_ioremap_nocache - Managed ioremap_nocache() * @dev: Generic device to remap IO address for -- -cgit v1.2.1-1-g437b +2.25.0 diff --git a/0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch b/0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch index 3c49ac5..75641b5 100644 --- a/0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch +++ b/0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch @@ -1,7 +1,7 @@ -From 3cec19068653e77d311382d7467728f5d424d4a3 Mon Sep 17 00:00:00 2001 +From dbc56c8785b2f6698722f3e9c189c7cb1f963679 Mon Sep 17 00:00:00 2001 From: Tuowen Zhao Date: Wed, 16 Oct 2019 15:06:29 -0600 -Subject: mfd: intel-lpss: Use devm_ioremap_uc for MMIO +Subject: [PATCH 03/16] mfd: intel-lpss: Use devm_ioremap_uc for MMIO Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci in MTRR. This will cause the system to hang during boot. If possible, @@ -44,5 +44,5 @@ index bfe4ff337581..b0f0781a6b9c 100644 if (!lpss->priv) return -ENOMEM; -- -cgit v1.2.1-1-g437b +2.25.0 diff --git a/0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch b/0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch deleted file mode 100644 index fc49e38..0000000 --- a/0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 271c8fe698d3ba5b3b135ffacfd1dc0c87243e32 Mon Sep 17 00:00:00 2001 -From: Mika Westerberg -Date: Tue, 29 Oct 2019 20:00:21 +0300 -Subject: PCI: pciehp: Do not disable interrupt twice on suspend - -We try to keep PCIe hotplug ports runtime suspended when entering system -suspend. Because the PCIe portdrv sets the DPM_FLAG_NEVER_SKIP flag, the PM -core always calls system suspend/resume hooks even if the device is left -runtime suspended. Since PCIe hotplug driver re-used the same function for -both runtime suspend and system suspend, it ended up disabling hotplug -interrupt twice and the second time following was printed: - - pciehp 0000:03:01.0:pcie204: pcie_do_write_cmd: no response from device - -Prevent this from happening by checking whether the device is already -runtime suspended when the system suspend hook is called. - -Fixes: 9c62f0bfb832 ("PCI: pciehp: Implement runtime PM callbacks") -Link: https://lore.kernel.org/r/20191029170022.57528-1-mika.westerberg@linux.intel.com -Reported-by: Kai-Heng Feng -Tested-by: Kai-Heng Feng -Signed-off-by: Mika Westerberg -Signed-off-by: Bjorn Helgaas -Reviewed-by: Rafael J. Wysocki ---- - drivers/pci/hotplug/pciehp_core.c | 25 +++++++++++++++++++++++-- - 1 file changed, 23 insertions(+), 2 deletions(-) - -diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c -index b3122c151b80..56daad828c9e 100644 ---- a/drivers/pci/hotplug/pciehp_core.c -+++ b/drivers/pci/hotplug/pciehp_core.c -@@ -253,7 +253,7 @@ static bool pme_is_native(struct pcie_device *dev) - return pcie_ports_native || host->native_pme; - } - --static int pciehp_suspend(struct pcie_device *dev) -+static void pciehp_disable_interrupt(struct pcie_device *dev) - { - /* - * Disable hotplug interrupt so that it does not trigger -@@ -261,7 +261,19 @@ static int pciehp_suspend(struct pcie_device *dev) - */ - if (pme_is_native(dev)) - pcie_disable_interrupt(get_service_data(dev)); -+} - -+#ifdef CONFIG_PM_SLEEP -+static int pciehp_suspend(struct pcie_device *dev) -+{ -+ /* -+ * If the port is already runtime suspended we can keep it that -+ * way. -+ */ -+ if (dev_pm_smart_suspend_and_suspended(&dev->port->dev)) -+ return 0; -+ -+ pciehp_disable_interrupt(dev); - return 0; - } - -@@ -279,6 +291,7 @@ static int pciehp_resume_noirq(struct pcie_device *dev) - - return 0; - } -+#endif - - static int pciehp_resume(struct pcie_device *dev) - { -@@ -292,6 +305,12 @@ static int pciehp_resume(struct pcie_device *dev) - return 0; - } - -+static int pciehp_runtime_suspend(struct pcie_device *dev) -+{ -+ pciehp_disable_interrupt(dev); -+ return 0; -+} -+ - static int pciehp_runtime_resume(struct pcie_device *dev) - { - struct controller *ctrl = get_service_data(dev); -@@ -318,10 +337,12 @@ static struct pcie_port_service_driver hpdriver_portdrv = { - .remove = pciehp_remove, - - #ifdef CONFIG_PM -+#ifdef CONFIG_PM_SLEEP - .suspend = pciehp_suspend, - .resume_noirq = pciehp_resume_noirq, - .resume = pciehp_resume, -- .runtime_suspend = pciehp_suspend, -+#endif -+ .runtime_suspend = pciehp_runtime_suspend, - .runtime_resume = pciehp_runtime_resume, - #endif /* PM */ - }; --- -cgit v1.2.1-1-g437b - diff --git a/0004-PCI-pciehp-Prevent-deadlock-on-disconnect.patch b/0004-PCI-pciehp-Prevent-deadlock-on-disconnect.patch new file mode 100644 index 0000000..b95179c --- /dev/null +++ b/0004-PCI-pciehp-Prevent-deadlock-on-disconnect.patch @@ -0,0 +1,272 @@ +From fa21078f336286d835bc734c8b4e4a24b67f245e Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Tue, 29 Oct 2019 20:00:22 +0300 +Subject: [PATCH 04/16] PCI: pciehp: Prevent deadlock on disconnect + +This addresses deadlocks in these common cases in hierarchies containing +two switches: + + - All involved ports are runtime suspended and they are unplugged. This + can happen easily if the drivers involved automatically enable runtime + PM (xHCI for example does that). + + - System is suspended (e.g., closing the lid on a laptop) with a dock + + something else connected, and the dock is unplugged while suspended. + +These cases lead to the following deadlock: + + INFO: task irq/126-pciehp:198 blocked for more than 120 seconds. + irq/126-pciehp D 0 198 2 0x80000000 + Call Trace: + schedule+0x2c/0x80 + schedule_timeout+0x246/0x350 + wait_for_completion+0xb7/0x140 + kthread_stop+0x49/0x110 + free_irq+0x32/0x70 + pcie_shutdown_notification+0x2f/0x50 + pciehp_remove+0x27/0x50 + pcie_port_remove_service+0x36/0x50 + device_release_driver+0x12/0x20 + bus_remove_device+0xec/0x160 + device_del+0x13b/0x350 + device_unregister+0x1a/0x60 + remove_iter+0x1e/0x30 + device_for_each_child+0x56/0x90 + pcie_port_device_remove+0x22/0x40 + pcie_portdrv_remove+0x20/0x60 + pci_device_remove+0x3e/0xc0 + device_release_driver_internal+0x18c/0x250 + device_release_driver+0x12/0x20 + pci_stop_bus_device+0x6f/0x90 + pci_stop_bus_device+0x31/0x90 + pci_stop_and_remove_bus_device+0x12/0x20 + pciehp_unconfigure_device+0x88/0x140 + pciehp_disable_slot+0x6a/0x110 + pciehp_handle_presence_or_link_change+0x263/0x400 + pciehp_ist+0x1c9/0x1d0 + irq_thread_fn+0x24/0x60 + irq_thread+0xeb/0x190 + kthread+0x120/0x140 + + INFO: task irq/190-pciehp:2288 blocked for more than 120 seconds. + irq/190-pciehp D 0 2288 2 0x80000000 + Call Trace: + __schedule+0x2a2/0x880 + schedule+0x2c/0x80 + schedule_preempt_disabled+0xe/0x10 + mutex_lock+0x2c/0x30 + pci_lock_rescan_remove+0x15/0x20 + pciehp_unconfigure_device+0x4d/0x140 + pciehp_disable_slot+0x6a/0x110 + pciehp_handle_presence_or_link_change+0x263/0x400 + pciehp_ist+0x1c9/0x1d0 + irq_thread_fn+0x24/0x60 + irq_thread+0xeb/0x190 + kthread+0x120/0x140 + +What happens here is that the whole hierarchy is runtime resumed and the +parent PCIe downstream port, which got the hot-remove event, starts +removing devices below it, taking pci_lock_rescan_remove() lock. When the +child PCIe port is runtime resumed it calls pciehp_check_presence() which +ends up calling pciehp_card_present() and pciehp_check_link_active(). Both +of these use pcie_capability_read_word(), which notices that the underlying +device is already gone and returns PCIBIOS_DEVICE_NOT_FOUND with the +capability value set to 0. When pciehp gets this value it thinks that its +child device is also hot-removed and schedules its IRQ thread to handle the +event. + +The deadlock happens when the child's IRQ thread runs and tries to acquire +pci_lock_rescan_remove() which is already taken by the parent and the +parent waits for the child's IRQ thread to finish. + +Prevent this from happening by checking the return value of +pcie_capability_read_word() and if it is PCIBIOS_DEVICE_NOT_FOUND stop +performing any hot-removal activities. + +[bhelgaas: add common scenarios to commit log] +Link: https://lore.kernel.org/r/20191029170022.57528-2-mika.westerberg@linux.intel.com +Tested-by: Kai-Heng Feng +Signed-off-by: Mika Westerberg +Signed-off-by: Bjorn Helgaas +--- + drivers/pci/hotplug/pciehp.h | 6 ++-- + drivers/pci/hotplug/pciehp_core.c | 11 ++++-- + drivers/pci/hotplug/pciehp_ctrl.c | 4 +-- + drivers/pci/hotplug/pciehp_hpc.c | 59 +++++++++++++++++++++++++------ + 4 files changed, 61 insertions(+), 19 deletions(-) + +diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h +index 882ce82c4699..aa61d4c219d7 100644 +--- a/drivers/pci/hotplug/pciehp.h ++++ b/drivers/pci/hotplug/pciehp.h +@@ -174,10 +174,10 @@ void pciehp_set_indicators(struct controller *ctrl, int pwr, int attn); + + void pciehp_get_latch_status(struct controller *ctrl, u8 *status); + int pciehp_query_power_fault(struct controller *ctrl); +-bool pciehp_card_present(struct controller *ctrl); +-bool pciehp_card_present_or_link_active(struct controller *ctrl); ++int pciehp_card_present(struct controller *ctrl); ++int pciehp_card_present_or_link_active(struct controller *ctrl); + int pciehp_check_link_status(struct controller *ctrl); +-bool pciehp_check_link_active(struct controller *ctrl); ++int pciehp_check_link_active(struct controller *ctrl); + void pciehp_release_ctrl(struct controller *ctrl); + + int pciehp_sysfs_enable_slot(struct hotplug_slot *hotplug_slot); +diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c +index 56daad828c9e..312cc45c44c7 100644 +--- a/drivers/pci/hotplug/pciehp_core.c ++++ b/drivers/pci/hotplug/pciehp_core.c +@@ -139,10 +139,15 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) + { + struct controller *ctrl = to_ctrl(hotplug_slot); + struct pci_dev *pdev = ctrl->pcie->port; ++ int ret; + + pci_config_pm_runtime_get(pdev); +- *value = pciehp_card_present_or_link_active(ctrl); ++ ret = pciehp_card_present_or_link_active(ctrl); + pci_config_pm_runtime_put(pdev); ++ if (ret < 0) ++ return ret; ++ ++ *value = ret; + return 0; + } + +@@ -158,13 +163,13 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) + */ + static void pciehp_check_presence(struct controller *ctrl) + { +- bool occupied; ++ int occupied; + + down_read(&ctrl->reset_lock); + mutex_lock(&ctrl->state_lock); + + occupied = pciehp_card_present_or_link_active(ctrl); +- if ((occupied && (ctrl->state == OFF_STATE || ++ if ((occupied > 0 && (ctrl->state == OFF_STATE || + ctrl->state == BLINKINGON_STATE)) || + (!occupied && (ctrl->state == ON_STATE || + ctrl->state == BLINKINGOFF_STATE))) +diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c +index dd8e4a5fb282..6503d15effbb 100644 +--- a/drivers/pci/hotplug/pciehp_ctrl.c ++++ b/drivers/pci/hotplug/pciehp_ctrl.c +@@ -226,7 +226,7 @@ void pciehp_handle_disable_request(struct controller *ctrl) + + void pciehp_handle_presence_or_link_change(struct controller *ctrl, u32 events) + { +- bool present, link_active; ++ int present, link_active; + + /* + * If the slot is on and presence or link has changed, turn it off. +@@ -257,7 +257,7 @@ void pciehp_handle_presence_or_link_change(struct controller *ctrl, u32 events) + mutex_lock(&ctrl->state_lock); + present = pciehp_card_present(ctrl); + link_active = pciehp_check_link_active(ctrl); +- if (!present && !link_active) { ++ if (present <= 0 && link_active <= 0) { + mutex_unlock(&ctrl->state_lock); + return; + } +diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c +index 86d97f3112f0..a2a263764ef8 100644 +--- a/drivers/pci/hotplug/pciehp_hpc.c ++++ b/drivers/pci/hotplug/pciehp_hpc.c +@@ -201,17 +201,29 @@ static void pcie_write_cmd_nowait(struct controller *ctrl, u16 cmd, u16 mask) + pcie_do_write_cmd(ctrl, cmd, mask, false); + } + +-bool pciehp_check_link_active(struct controller *ctrl) ++/** ++ * pciehp_check_link_active() - Is the link active ++ * @ctrl: PCIe hotplug controller ++ * ++ * Check whether the downstream link is currently active. Note it is ++ * possible that the card is removed immediately after this so the ++ * caller may need to take it into account. ++ * ++ * If the hotplug controller itself is not available anymore returns ++ * %-ENODEV. ++ */ ++int pciehp_check_link_active(struct controller *ctrl) + { + struct pci_dev *pdev = ctrl_dev(ctrl); + u16 lnk_status; +- bool ret; ++ int ret; + +- pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnk_status); +- ret = !!(lnk_status & PCI_EXP_LNKSTA_DLLLA); ++ ret = pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnk_status); ++ if (ret == PCIBIOS_DEVICE_NOT_FOUND || lnk_status == (u16)~0) ++ return -ENODEV; + +- if (ret) +- ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); ++ ret = !!(lnk_status & PCI_EXP_LNKSTA_DLLLA); ++ ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); + + return ret; + } +@@ -373,13 +385,29 @@ void pciehp_get_latch_status(struct controller *ctrl, u8 *status) + *status = !!(slot_status & PCI_EXP_SLTSTA_MRLSS); + } + +-bool pciehp_card_present(struct controller *ctrl) ++/** ++ * pciehp_card_present() - Is the card present ++ * @ctrl: PCIe hotplug controller ++ * ++ * Function checks whether the card is currently present in the slot and ++ * in that case returns true. Note it is possible that the card is ++ * removed immediately after the check so the caller may need to take ++ * this into account. ++ * ++ * It the hotplug controller itself is not available anymore returns ++ * %-ENODEV. ++ */ ++int pciehp_card_present(struct controller *ctrl) + { + struct pci_dev *pdev = ctrl_dev(ctrl); + u16 slot_status; ++ int ret; + +- pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); +- return slot_status & PCI_EXP_SLTSTA_PDS; ++ ret = pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); ++ if (ret == PCIBIOS_DEVICE_NOT_FOUND || slot_status == (u16)~0) ++ return -ENODEV; ++ ++ return !!(slot_status & PCI_EXP_SLTSTA_PDS); + } + + /** +@@ -390,10 +418,19 @@ bool pciehp_card_present(struct controller *ctrl) + * Presence Detect State bit, this helper also returns true if the Link Active + * bit is set. This is a concession to broken hotplug ports which hardwire + * Presence Detect State to zero, such as Wilocity's [1ae9:0200]. ++ * ++ * Returns: %1 if the slot is occupied and %0 if it is not. If the hotplug ++ * port is not present anymore returns %-ENODEV. + */ +-bool pciehp_card_present_or_link_active(struct controller *ctrl) ++int pciehp_card_present_or_link_active(struct controller *ctrl) + { +- return pciehp_card_present(ctrl) || pciehp_check_link_active(ctrl); ++ int ret; ++ ++ ret = pciehp_card_present(ctrl); ++ if (ret) ++ return ret; ++ ++ return pciehp_check_link_active(ctrl); + } + + int pciehp_query_power_fault(struct controller *ctrl) +-- +2.25.0 + diff --git a/0005-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch b/0005-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch new file mode 100644 index 0000000..9abef27 --- /dev/null +++ b/0005-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch @@ -0,0 +1,78 @@ +From 7f6991978c1c388c2b11bb8101e4658f81fe85ed Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Thu, 28 Nov 2019 23:50:40 +0100 +Subject: [PATCH 05/16] ACPI: PM: s2idle: Rework ACPI events synchronization + +Note that the EC GPE processing need not be synchronized in +acpi_s2idle_wake() after invoking acpi_ec_dispatch_gpe(), because +that function checks the GPE status and dispatches its handler if +need be and the SCI action handler is not going to run anyway at +that point. + +Moreover, it is better to drain all of the pending ACPI events +before restoring the working-state configuration of GPEs in +acpi_s2idle_restore(), because those events are likely to be related +to system wakeup, in which case they will not be relevant going +forward. + +Rework the code to take these observations into account. + +Signed-off-by: Rafael J. Wysocki +--- + drivers/acpi/sleep.c | 26 +++++++++++++++++++------- + 1 file changed, 19 insertions(+), 7 deletions(-) + +diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c +index 2af937a8b1c5..6747a279621b 100644 +--- a/drivers/acpi/sleep.c ++++ b/drivers/acpi/sleep.c +@@ -977,6 +977,16 @@ static int acpi_s2idle_prepare_late(void) + return 0; + } + ++static void acpi_s2idle_sync(void) ++{ ++ /* ++ * The EC driver uses the system workqueue and an additional special ++ * one, so those need to be flushed too. ++ */ ++ acpi_ec_flush_work(); ++ acpi_os_wait_events_complete(); /* synchronize Notify handling */ ++} ++ + static void acpi_s2idle_wake(void) + { + /* +@@ -1001,13 +1011,8 @@ static void acpi_s2idle_wake(void) + * should be missed by canceling the wakeup here. + */ + pm_system_cancel_wakeup(); +- /* +- * The EC driver uses the system workqueue and an additional +- * special one, so those need to be flushed too. +- */ +- acpi_os_wait_events_complete(); /* synchronize EC GPE processing */ +- acpi_ec_flush_work(); +- acpi_os_wait_events_complete(); /* synchronize Notify handling */ ++ ++ acpi_s2idle_sync(); + + rearm_wake_irq(acpi_sci_irq); + } +@@ -1024,6 +1029,13 @@ static void acpi_s2idle_restore_early(void) + + static void acpi_s2idle_restore(void) + { ++ /* ++ * Drain pending events before restoring the working-state configuration ++ * of GPEs. ++ */ ++ acpi_os_wait_events_complete(); /* synchronize GPE processing */ ++ acpi_s2idle_sync(); ++ + s2idle_wakeup = false; + + acpi_enable_all_runtime_gpes(); +-- +2.25.0 + diff --git a/0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch b/0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch deleted file mode 100644 index d882f59..0000000 --- a/0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch +++ /dev/null @@ -1,272 +0,0 @@ -From 8d032e7fc1d1d37974785ccdb994524d60201ca3 Mon Sep 17 00:00:00 2001 -From: Mika Westerberg -Date: Tue, 29 Oct 2019 20:00:22 +0300 -Subject: PCI: pciehp: Prevent deadlock on disconnect - -This addresses deadlocks in these common cases in hierarchies containing -two switches: - - - All involved ports are runtime suspended and they are unplugged. This - can happen easily if the drivers involved automatically enable runtime - PM (xHCI for example does that). - - - System is suspended (e.g., closing the lid on a laptop) with a dock + - something else connected, and the dock is unplugged while suspended. - -These cases lead to the following deadlock: - - INFO: task irq/126-pciehp:198 blocked for more than 120 seconds. - irq/126-pciehp D 0 198 2 0x80000000 - Call Trace: - schedule+0x2c/0x80 - schedule_timeout+0x246/0x350 - wait_for_completion+0xb7/0x140 - kthread_stop+0x49/0x110 - free_irq+0x32/0x70 - pcie_shutdown_notification+0x2f/0x50 - pciehp_remove+0x27/0x50 - pcie_port_remove_service+0x36/0x50 - device_release_driver+0x12/0x20 - bus_remove_device+0xec/0x160 - device_del+0x13b/0x350 - device_unregister+0x1a/0x60 - remove_iter+0x1e/0x30 - device_for_each_child+0x56/0x90 - pcie_port_device_remove+0x22/0x40 - pcie_portdrv_remove+0x20/0x60 - pci_device_remove+0x3e/0xc0 - device_release_driver_internal+0x18c/0x250 - device_release_driver+0x12/0x20 - pci_stop_bus_device+0x6f/0x90 - pci_stop_bus_device+0x31/0x90 - pci_stop_and_remove_bus_device+0x12/0x20 - pciehp_unconfigure_device+0x88/0x140 - pciehp_disable_slot+0x6a/0x110 - pciehp_handle_presence_or_link_change+0x263/0x400 - pciehp_ist+0x1c9/0x1d0 - irq_thread_fn+0x24/0x60 - irq_thread+0xeb/0x190 - kthread+0x120/0x140 - - INFO: task irq/190-pciehp:2288 blocked for more than 120 seconds. - irq/190-pciehp D 0 2288 2 0x80000000 - Call Trace: - __schedule+0x2a2/0x880 - schedule+0x2c/0x80 - schedule_preempt_disabled+0xe/0x10 - mutex_lock+0x2c/0x30 - pci_lock_rescan_remove+0x15/0x20 - pciehp_unconfigure_device+0x4d/0x140 - pciehp_disable_slot+0x6a/0x110 - pciehp_handle_presence_or_link_change+0x263/0x400 - pciehp_ist+0x1c9/0x1d0 - irq_thread_fn+0x24/0x60 - irq_thread+0xeb/0x190 - kthread+0x120/0x140 - -What happens here is that the whole hierarchy is runtime resumed and the -parent PCIe downstream port, which got the hot-remove event, starts -removing devices below it, taking pci_lock_rescan_remove() lock. When the -child PCIe port is runtime resumed it calls pciehp_check_presence() which -ends up calling pciehp_card_present() and pciehp_check_link_active(). Both -of these use pcie_capability_read_word(), which notices that the underlying -device is already gone and returns PCIBIOS_DEVICE_NOT_FOUND with the -capability value set to 0. When pciehp gets this value it thinks that its -child device is also hot-removed and schedules its IRQ thread to handle the -event. - -The deadlock happens when the child's IRQ thread runs and tries to acquire -pci_lock_rescan_remove() which is already taken by the parent and the -parent waits for the child's IRQ thread to finish. - -Prevent this from happening by checking the return value of -pcie_capability_read_word() and if it is PCIBIOS_DEVICE_NOT_FOUND stop -performing any hot-removal activities. - -[bhelgaas: add common scenarios to commit log] -Link: https://lore.kernel.org/r/20191029170022.57528-2-mika.westerberg@linux.intel.com -Tested-by: Kai-Heng Feng -Signed-off-by: Mika Westerberg -Signed-off-by: Bjorn Helgaas ---- - drivers/pci/hotplug/pciehp.h | 6 ++-- - drivers/pci/hotplug/pciehp_core.c | 11 ++++++-- - drivers/pci/hotplug/pciehp_ctrl.c | 4 +-- - drivers/pci/hotplug/pciehp_hpc.c | 59 +++++++++++++++++++++++++++++++-------- - 4 files changed, 61 insertions(+), 19 deletions(-) - -diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h -index 882ce82c4699..aa61d4c219d7 100644 ---- a/drivers/pci/hotplug/pciehp.h -+++ b/drivers/pci/hotplug/pciehp.h -@@ -174,10 +174,10 @@ void pciehp_set_indicators(struct controller *ctrl, int pwr, int attn); - - void pciehp_get_latch_status(struct controller *ctrl, u8 *status); - int pciehp_query_power_fault(struct controller *ctrl); --bool pciehp_card_present(struct controller *ctrl); --bool pciehp_card_present_or_link_active(struct controller *ctrl); -+int pciehp_card_present(struct controller *ctrl); -+int pciehp_card_present_or_link_active(struct controller *ctrl); - int pciehp_check_link_status(struct controller *ctrl); --bool pciehp_check_link_active(struct controller *ctrl); -+int pciehp_check_link_active(struct controller *ctrl); - void pciehp_release_ctrl(struct controller *ctrl); - - int pciehp_sysfs_enable_slot(struct hotplug_slot *hotplug_slot); -diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c -index 56daad828c9e..312cc45c44c7 100644 ---- a/drivers/pci/hotplug/pciehp_core.c -+++ b/drivers/pci/hotplug/pciehp_core.c -@@ -139,10 +139,15 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) - { - struct controller *ctrl = to_ctrl(hotplug_slot); - struct pci_dev *pdev = ctrl->pcie->port; -+ int ret; - - pci_config_pm_runtime_get(pdev); -- *value = pciehp_card_present_or_link_active(ctrl); -+ ret = pciehp_card_present_or_link_active(ctrl); - pci_config_pm_runtime_put(pdev); -+ if (ret < 0) -+ return ret; -+ -+ *value = ret; - return 0; - } - -@@ -158,13 +163,13 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) - */ - static void pciehp_check_presence(struct controller *ctrl) - { -- bool occupied; -+ int occupied; - - down_read(&ctrl->reset_lock); - mutex_lock(&ctrl->state_lock); - - occupied = pciehp_card_present_or_link_active(ctrl); -- if ((occupied && (ctrl->state == OFF_STATE || -+ if ((occupied > 0 && (ctrl->state == OFF_STATE || - ctrl->state == BLINKINGON_STATE)) || - (!occupied && (ctrl->state == ON_STATE || - ctrl->state == BLINKINGOFF_STATE))) -diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c -index dd8e4a5fb282..6503d15effbb 100644 ---- a/drivers/pci/hotplug/pciehp_ctrl.c -+++ b/drivers/pci/hotplug/pciehp_ctrl.c -@@ -226,7 +226,7 @@ void pciehp_handle_disable_request(struct controller *ctrl) - - void pciehp_handle_presence_or_link_change(struct controller *ctrl, u32 events) - { -- bool present, link_active; -+ int present, link_active; - - /* - * If the slot is on and presence or link has changed, turn it off. -@@ -257,7 +257,7 @@ void pciehp_handle_presence_or_link_change(struct controller *ctrl, u32 events) - mutex_lock(&ctrl->state_lock); - present = pciehp_card_present(ctrl); - link_active = pciehp_check_link_active(ctrl); -- if (!present && !link_active) { -+ if (present <= 0 && link_active <= 0) { - mutex_unlock(&ctrl->state_lock); - return; - } -diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c -index 86d97f3112f0..a2a263764ef8 100644 ---- a/drivers/pci/hotplug/pciehp_hpc.c -+++ b/drivers/pci/hotplug/pciehp_hpc.c -@@ -201,17 +201,29 @@ static void pcie_write_cmd_nowait(struct controller *ctrl, u16 cmd, u16 mask) - pcie_do_write_cmd(ctrl, cmd, mask, false); - } - --bool pciehp_check_link_active(struct controller *ctrl) -+/** -+ * pciehp_check_link_active() - Is the link active -+ * @ctrl: PCIe hotplug controller -+ * -+ * Check whether the downstream link is currently active. Note it is -+ * possible that the card is removed immediately after this so the -+ * caller may need to take it into account. -+ * -+ * If the hotplug controller itself is not available anymore returns -+ * %-ENODEV. -+ */ -+int pciehp_check_link_active(struct controller *ctrl) - { - struct pci_dev *pdev = ctrl_dev(ctrl); - u16 lnk_status; -- bool ret; -+ int ret; - -- pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnk_status); -- ret = !!(lnk_status & PCI_EXP_LNKSTA_DLLLA); -+ ret = pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnk_status); -+ if (ret == PCIBIOS_DEVICE_NOT_FOUND || lnk_status == (u16)~0) -+ return -ENODEV; - -- if (ret) -- ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); -+ ret = !!(lnk_status & PCI_EXP_LNKSTA_DLLLA); -+ ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); - - return ret; - } -@@ -373,13 +385,29 @@ void pciehp_get_latch_status(struct controller *ctrl, u8 *status) - *status = !!(slot_status & PCI_EXP_SLTSTA_MRLSS); - } - --bool pciehp_card_present(struct controller *ctrl) -+/** -+ * pciehp_card_present() - Is the card present -+ * @ctrl: PCIe hotplug controller -+ * -+ * Function checks whether the card is currently present in the slot and -+ * in that case returns true. Note it is possible that the card is -+ * removed immediately after the check so the caller may need to take -+ * this into account. -+ * -+ * It the hotplug controller itself is not available anymore returns -+ * %-ENODEV. -+ */ -+int pciehp_card_present(struct controller *ctrl) - { - struct pci_dev *pdev = ctrl_dev(ctrl); - u16 slot_status; -+ int ret; - -- pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); -- return slot_status & PCI_EXP_SLTSTA_PDS; -+ ret = pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); -+ if (ret == PCIBIOS_DEVICE_NOT_FOUND || slot_status == (u16)~0) -+ return -ENODEV; -+ -+ return !!(slot_status & PCI_EXP_SLTSTA_PDS); - } - - /** -@@ -390,10 +418,19 @@ bool pciehp_card_present(struct controller *ctrl) - * Presence Detect State bit, this helper also returns true if the Link Active - * bit is set. This is a concession to broken hotplug ports which hardwire - * Presence Detect State to zero, such as Wilocity's [1ae9:0200]. -+ * -+ * Returns: %1 if the slot is occupied and %0 if it is not. If the hotplug -+ * port is not present anymore returns %-ENODEV. - */ --bool pciehp_card_present_or_link_active(struct controller *ctrl) -+int pciehp_card_present_or_link_active(struct controller *ctrl) - { -- return pciehp_card_present(ctrl) || pciehp_check_link_active(ctrl); -+ int ret; -+ -+ ret = pciehp_card_present(ctrl); -+ if (ret) -+ return ret; -+ -+ return pciehp_check_link_active(ctrl); - } - - int pciehp_query_power_fault(struct controller *ctrl) --- -cgit v1.2.1-1-g437b - diff --git a/0006-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch b/0006-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch deleted file mode 100644 index 3b6703d..0000000 --- a/0006-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 9888be9033e8e79a055df2ae8d388baf5970f83b Mon Sep 17 00:00:00 2001 -From: "Rafael J. Wysocki" -Date: Thu, 28 Nov 2019 23:50:40 +0100 -Subject: ACPI: PM: s2idle: Rework ACPI events synchronization - -Note that the EC GPE processing need not be synchronized in -acpi_s2idle_wake() after invoking acpi_ec_dispatch_gpe(), because -that function checks the GPE status and dispatches its handler if -need be and the SCI action handler is not going to run anyway at -that point. - -Moreover, it is better to drain all of the pending ACPI events -before restoring the working-state configuration of GPEs in -acpi_s2idle_restore(), because those events are likely to be related -to system wakeup, in which case they will not be relevant going -forward. - -Rework the code to take these observations into account. - -Signed-off-by: Rafael J. Wysocki ---- - drivers/acpi/sleep.c | 26 +++++++++++++++++++------- - 1 file changed, 19 insertions(+), 7 deletions(-) - -diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c -index 2af937a8b1c5..6747a279621b 100644 ---- a/drivers/acpi/sleep.c -+++ b/drivers/acpi/sleep.c -@@ -977,6 +977,16 @@ static int acpi_s2idle_prepare_late(void) - return 0; - } - -+static void acpi_s2idle_sync(void) -+{ -+ /* -+ * The EC driver uses the system workqueue and an additional special -+ * one, so those need to be flushed too. -+ */ -+ acpi_ec_flush_work(); -+ acpi_os_wait_events_complete(); /* synchronize Notify handling */ -+} -+ - static void acpi_s2idle_wake(void) - { - /* -@@ -1001,13 +1011,8 @@ static void acpi_s2idle_wake(void) - * should be missed by canceling the wakeup here. - */ - pm_system_cancel_wakeup(); -- /* -- * The EC driver uses the system workqueue and an additional -- * special one, so those need to be flushed too. -- */ -- acpi_os_wait_events_complete(); /* synchronize EC GPE processing */ -- acpi_ec_flush_work(); -- acpi_os_wait_events_complete(); /* synchronize Notify handling */ -+ -+ acpi_s2idle_sync(); - - rearm_wake_irq(acpi_sci_irq); - } -@@ -1024,6 +1029,13 @@ static void acpi_s2idle_restore_early(void) - - static void acpi_s2idle_restore(void) - { -+ /* -+ * Drain pending events before restoring the working-state configuration -+ * of GPEs. -+ */ -+ acpi_os_wait_events_complete(); /* synchronize GPE processing */ -+ acpi_s2idle_sync(); -+ - s2idle_wakeup = false; - - acpi_enable_all_runtime_gpes(); --- -cgit v1.2.1-1-g437b - diff --git a/0006-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch b/0006-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch new file mode 100644 index 0000000..2f69a8a --- /dev/null +++ b/0006-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch @@ -0,0 +1,36 @@ +From 50b253fe7f01a82c8054d88319598db71ae5d083 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Tue, 24 Dec 2019 05:18:47 +0100 +Subject: [PATCH 06/16] iwlwifi: pcie: restore support for Killer Qu C0 NICs + +Commit 809805a820c6 refactored the cfg mangling. Unfortunately, in this +process the lines which picked the right cfg for Killer Qu C0 NICs after +C0 detection were lost. These lines were added by commit b9500577d361. + +I suspect this is more of the "merge damage" which commit 7cded5658329 +talks about. + +Fixes: 809805a820c6 ("iwlwifi: pcie: move some cfg mangling from trans_pcie_alloc to probe") +Signed-off-by: Jan Alexander Steffens (heftig) +--- + drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +index b0b7eca1754e..de62a6dc4e73 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +@@ -1107,6 +1107,10 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + cfg = &iwl9560_2ac_cfg_qu_c0_jf_b0; + else if (cfg == &iwl9560_2ac_160_cfg_qu_b0_jf_b0) + cfg = &iwl9560_2ac_160_cfg_qu_c0_jf_b0; ++ else if (cfg == &killer1650s_2ax_cfg_qu_b0_hr_b0) ++ cfg = &killer1650s_2ax_cfg_qu_c0_hr_b0; ++ else if (cfg == &killer1650i_2ax_cfg_qu_b0_hr_b0) ++ cfg = &killer1650i_2ax_cfg_qu_c0_hr_b0; + } + + /* same thing for QuZ... */ +-- +2.25.0 + diff --git a/0007-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-s.patch b/0007-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-s.patch new file mode 100644 index 0000000..a128921 --- /dev/null +++ b/0007-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-s.patch @@ -0,0 +1,87 @@ +From e0a3ce4a9ebf049e76ea38c48e41f2c67f4b3330 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Fri, 20 Sep 2019 11:39:18 +0300 +Subject: [PATCH 07/16] drm/i915: save AUD_FREQ_CNTRL state at audio domain + suspend + +When audio power domain is suspended, the display driver must +save state of AUD_FREQ_CNTRL on Tiger Lake and Ice Lake +systems. The initial value of the register is set by BIOS and +is read by driver during the audio component init sequence. + +Cc: Jani Nikula +Cc: Imre Deak +Signed-off-by: Kai Vehmanen +Signed-off-by: Jani Nikula +Link: https://patchwork.freedesktop.org/patch/msgid/20190920083918.27057-1-kai.vehmanen@linux.intel.com +--- + drivers/gpu/drm/i915/display/intel_audio.c | 17 +++++++++++++++-- + drivers/gpu/drm/i915/i915_drv.h | 1 + + drivers/gpu/drm/i915/i915_reg.h | 2 ++ + 3 files changed, 18 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c +index ddcccf4408c3..439bc0a93410 100644 +--- a/drivers/gpu/drm/i915/display/intel_audio.c ++++ b/drivers/gpu/drm/i915/display/intel_audio.c +@@ -850,10 +850,17 @@ static unsigned long i915_audio_component_get_power(struct device *kdev) + + ret = intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO); + +- /* Force CDCLK to 2*BCLK as long as we need audio to be powered. */ +- if (dev_priv->audio_power_refcount++ == 0) ++ if (dev_priv->audio_power_refcount++ == 0) { ++ if (IS_TIGERLAKE(dev_priv) || IS_ICELAKE(dev_priv)) { ++ I915_WRITE(AUD_FREQ_CNTRL, dev_priv->audio_freq_cntrl); ++ DRM_DEBUG_KMS("restored AUD_FREQ_CNTRL to 0x%x\n", ++ dev_priv->audio_freq_cntrl); ++ } ++ ++ /* Force CDCLK to 2*BCLK as long as we need audio powered. */ + if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)) + glk_force_audio_cdclk(dev_priv, true); ++ } + + return ret; + } +@@ -1114,6 +1121,12 @@ static void i915_audio_component_init(struct drm_i915_private *dev_priv) + return; + } + ++ if (IS_TIGERLAKE(dev_priv) || IS_ICELAKE(dev_priv)) { ++ dev_priv->audio_freq_cntrl = I915_READ(AUD_FREQ_CNTRL); ++ DRM_DEBUG_KMS("init value of AUD_FREQ_CNTRL of 0x%x\n", ++ dev_priv->audio_freq_cntrl); ++ } ++ + dev_priv->audio_component_registered = true; + } + +diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h +index 89b6112bd66b..043ce1b47aeb 100644 +--- a/drivers/gpu/drm/i915/i915_drv.h ++++ b/drivers/gpu/drm/i915/i915_drv.h +@@ -1530,6 +1530,7 @@ struct drm_i915_private { + */ + struct mutex av_mutex; + int audio_power_refcount; ++ u32 audio_freq_cntrl; + + struct { + struct mutex mutex; +diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h +index 7b6e68f082f8..a99ef18665f2 100644 +--- a/drivers/gpu/drm/i915/i915_reg.h ++++ b/drivers/gpu/drm/i915/i915_reg.h +@@ -9110,6 +9110,8 @@ enum { + #define HSW_AUD_CHICKENBIT _MMIO(0x65f10) + #define SKL_AUD_CODEC_WAKE_SIGNAL (1 << 15) + ++#define AUD_FREQ_CNTRL _MMIO(0x65900) ++ + /* + * HSW - ICL power wells + * +-- +2.25.0 + diff --git a/0007-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch b/0007-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch deleted file mode 100644 index 7611c7a..0000000 --- a/0007-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch +++ /dev/null @@ -1,36 +0,0 @@ -From fd1d146698d09aaac6709ae4fde90d80dbd153cd Mon Sep 17 00:00:00 2001 -From: "Jan Alexander Steffens (heftig)" -Date: Tue, 24 Dec 2019 05:18:47 +0100 -Subject: iwlwifi: pcie: restore support for Killer Qu C0 NICs - -Commit 809805a820c6 refactored the cfg mangling. Unfortunately, in this -process the lines which picked the right cfg for Killer Qu C0 NICs after -C0 detection were lost. These lines were added by commit b9500577d361. - -I suspect this is more of the "merge damage" which commit 7cded5658329 -talks about. - -Fixes: 809805a820c6 ("iwlwifi: pcie: move some cfg mangling from trans_pcie_alloc to probe") -Signed-off-by: Jan Alexander Steffens (heftig) ---- - drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c -index b0b7eca1754e..de62a6dc4e73 100644 ---- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c -+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c -@@ -1107,6 +1107,10 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) - cfg = &iwl9560_2ac_cfg_qu_c0_jf_b0; - else if (cfg == &iwl9560_2ac_160_cfg_qu_b0_jf_b0) - cfg = &iwl9560_2ac_160_cfg_qu_c0_jf_b0; -+ else if (cfg == &killer1650s_2ax_cfg_qu_b0_hr_b0) -+ cfg = &killer1650s_2ax_cfg_qu_c0_hr_b0; -+ else if (cfg == &killer1650i_2ax_cfg_qu_b0_hr_b0) -+ cfg = &killer1650i_2ax_cfg_qu_c0_hr_b0; - } - - /* same thing for QuZ... */ --- -cgit v1.2.1-1-g437b - diff --git a/0008-drm-i915-Fix-audio-power-up-sequence-for-gen10-displ.patch b/0008-drm-i915-Fix-audio-power-up-sequence-for-gen10-displ.patch new file mode 100644 index 0000000..aa403bc --- /dev/null +++ b/0008-drm-i915-Fix-audio-power-up-sequence-for-gen10-displ.patch @@ -0,0 +1,57 @@ +From e4bcd75c297598b87b89533c2c995f7d88c12010 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Thu, 3 Oct 2019 11:55:30 +0300 +Subject: [PATCH 08/16] drm/i915: Fix audio power up sequence for gen10+ + display + +On platfroms with gen10+ display, driver must set the enable bit of +AUDIO_PIN_BUF_CTL register before transactions with the HDA controller +can proceed. Add setting this bit to the audio power up sequence. + +Failing to do this resulted in errors during display audio codec probe, +and failures during resume from suspend. + +Note: We may also need to disable the bit afterwards, but there are +still unresolved issues with that. + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111214 +Signed-off-by: Kai Vehmanen +Signed-off-by: Jani Nikula +Link: https://patchwork.freedesktop.org/patch/msgid/20191003085531.30990-1-kai.vehmanen@linux.intel.com +--- + drivers/gpu/drm/i915/display/intel_audio.c | 5 +++++ + drivers/gpu/drm/i915/i915_reg.h | 2 ++ + 2 files changed, 7 insertions(+) + +diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c +index 439bc0a93410..440b33762fef 100644 +--- a/drivers/gpu/drm/i915/display/intel_audio.c ++++ b/drivers/gpu/drm/i915/display/intel_audio.c +@@ -860,6 +860,11 @@ static unsigned long i915_audio_component_get_power(struct device *kdev) + /* Force CDCLK to 2*BCLK as long as we need audio powered. */ + if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)) + glk_force_audio_cdclk(dev_priv, true); ++ ++ if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) ++ I915_WRITE(AUD_PIN_BUF_CTL, ++ (I915_READ(AUD_PIN_BUF_CTL) | ++ AUD_PIN_BUF_ENABLE)); + } + + return ret; +diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h +index a99ef18665f2..1dd7b6187780 100644 +--- a/drivers/gpu/drm/i915/i915_reg.h ++++ b/drivers/gpu/drm/i915/i915_reg.h +@@ -9111,6 +9111,8 @@ enum { + #define SKL_AUD_CODEC_WAKE_SIGNAL (1 << 15) + + #define AUD_FREQ_CNTRL _MMIO(0x65900) ++#define AUD_PIN_BUF_CTL _MMIO(0x48414) ++#define AUD_PIN_BUF_ENABLE REG_BIT(31) + + /* + * HSW - ICL power wells +-- +2.25.0 + diff --git a/0008-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-suspend.patch b/0008-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-suspend.patch deleted file mode 100644 index 6ea75b6..0000000 --- a/0008-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-suspend.patch +++ /dev/null @@ -1,86 +0,0 @@ -From c0da4d4ee458208d5427d0a284173bd39a95d040 Mon Sep 17 00:00:00 2001 -From: Kai Vehmanen -Date: Fri, 20 Sep 2019 11:39:18 +0300 -Subject: drm/i915: save AUD_FREQ_CNTRL state at audio domain suspend - -When audio power domain is suspended, the display driver must -save state of AUD_FREQ_CNTRL on Tiger Lake and Ice Lake -systems. The initial value of the register is set by BIOS and -is read by driver during the audio component init sequence. - -Cc: Jani Nikula -Cc: Imre Deak -Signed-off-by: Kai Vehmanen -Signed-off-by: Jani Nikula -Link: https://patchwork.freedesktop.org/patch/msgid/20190920083918.27057-1-kai.vehmanen@linux.intel.com ---- - drivers/gpu/drm/i915/display/intel_audio.c | 17 +++++++++++++++-- - drivers/gpu/drm/i915/i915_drv.h | 1 + - drivers/gpu/drm/i915/i915_reg.h | 2 ++ - 3 files changed, 18 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c -index ddcccf4408c3..439bc0a93410 100644 ---- a/drivers/gpu/drm/i915/display/intel_audio.c -+++ b/drivers/gpu/drm/i915/display/intel_audio.c -@@ -850,10 +850,17 @@ static unsigned long i915_audio_component_get_power(struct device *kdev) - - ret = intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO); - -- /* Force CDCLK to 2*BCLK as long as we need audio to be powered. */ -- if (dev_priv->audio_power_refcount++ == 0) -+ if (dev_priv->audio_power_refcount++ == 0) { -+ if (IS_TIGERLAKE(dev_priv) || IS_ICELAKE(dev_priv)) { -+ I915_WRITE(AUD_FREQ_CNTRL, dev_priv->audio_freq_cntrl); -+ DRM_DEBUG_KMS("restored AUD_FREQ_CNTRL to 0x%x\n", -+ dev_priv->audio_freq_cntrl); -+ } -+ -+ /* Force CDCLK to 2*BCLK as long as we need audio powered. */ - if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)) - glk_force_audio_cdclk(dev_priv, true); -+ } - - return ret; - } -@@ -1114,6 +1121,12 @@ static void i915_audio_component_init(struct drm_i915_private *dev_priv) - return; - } - -+ if (IS_TIGERLAKE(dev_priv) || IS_ICELAKE(dev_priv)) { -+ dev_priv->audio_freq_cntrl = I915_READ(AUD_FREQ_CNTRL); -+ DRM_DEBUG_KMS("init value of AUD_FREQ_CNTRL of 0x%x\n", -+ dev_priv->audio_freq_cntrl); -+ } -+ - dev_priv->audio_component_registered = true; - } - -diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h -index 89b6112bd66b..043ce1b47aeb 100644 ---- a/drivers/gpu/drm/i915/i915_drv.h -+++ b/drivers/gpu/drm/i915/i915_drv.h -@@ -1530,6 +1530,7 @@ struct drm_i915_private { - */ - struct mutex av_mutex; - int audio_power_refcount; -+ u32 audio_freq_cntrl; - - struct { - struct mutex mutex; -diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h -index f8ee9aba3955..e1fe356463ec 100644 ---- a/drivers/gpu/drm/i915/i915_reg.h -+++ b/drivers/gpu/drm/i915/i915_reg.h -@@ -9104,6 +9104,8 @@ enum { - #define HSW_AUD_CHICKENBIT _MMIO(0x65f10) - #define SKL_AUD_CODEC_WAKE_SIGNAL (1 << 15) - -+#define AUD_FREQ_CNTRL _MMIO(0x65900) -+ - /* - * HSW - ICL power wells - * --- -cgit v1.2.1-1-g437b - diff --git a/0009-drm-i915-Fix-audio-power-up-sequence-for-gen10-display.patch b/0009-drm-i915-Fix-audio-power-up-sequence-for-gen10-display.patch deleted file mode 100644 index 7c46dbe..0000000 --- a/0009-drm-i915-Fix-audio-power-up-sequence-for-gen10-display.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 6e149a5538676e885561f1dfc18bbb4dd104c1f6 Mon Sep 17 00:00:00 2001 -From: Kai Vehmanen -Date: Thu, 3 Oct 2019 11:55:30 +0300 -Subject: drm/i915: Fix audio power up sequence for gen10+ display - -On platfroms with gen10+ display, driver must set the enable bit of -AUDIO_PIN_BUF_CTL register before transactions with the HDA controller -can proceed. Add setting this bit to the audio power up sequence. - -Failing to do this resulted in errors during display audio codec probe, -and failures during resume from suspend. - -Note: We may also need to disable the bit afterwards, but there are -still unresolved issues with that. - -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111214 -Signed-off-by: Kai Vehmanen -Signed-off-by: Jani Nikula -Link: https://patchwork.freedesktop.org/patch/msgid/20191003085531.30990-1-kai.vehmanen@linux.intel.com ---- - drivers/gpu/drm/i915/display/intel_audio.c | 5 +++++ - drivers/gpu/drm/i915/i915_reg.h | 2 ++ - 2 files changed, 7 insertions(+) - -diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c -index 439bc0a93410..440b33762fef 100644 ---- a/drivers/gpu/drm/i915/display/intel_audio.c -+++ b/drivers/gpu/drm/i915/display/intel_audio.c -@@ -860,6 +860,11 @@ static unsigned long i915_audio_component_get_power(struct device *kdev) - /* Force CDCLK to 2*BCLK as long as we need audio powered. */ - if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)) - glk_force_audio_cdclk(dev_priv, true); -+ -+ if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) -+ I915_WRITE(AUD_PIN_BUF_CTL, -+ (I915_READ(AUD_PIN_BUF_CTL) | -+ AUD_PIN_BUF_ENABLE)); - } - - return ret; -diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h -index e1fe356463ec..ccfea9c2b8bf 100644 ---- a/drivers/gpu/drm/i915/i915_reg.h -+++ b/drivers/gpu/drm/i915/i915_reg.h -@@ -9105,6 +9105,8 @@ enum { - #define SKL_AUD_CODEC_WAKE_SIGNAL (1 << 15) - - #define AUD_FREQ_CNTRL _MMIO(0x65900) -+#define AUD_PIN_BUF_CTL _MMIO(0x48414) -+#define AUD_PIN_BUF_ENABLE REG_BIT(31) - - /* - * HSW - ICL power wells --- -cgit v1.2.1-1-g437b - diff --git a/0009-drm-i915-extend-audio-CDCLK-2-BCLK-constraint-to-mor.patch b/0009-drm-i915-extend-audio-CDCLK-2-BCLK-constraint-to-mor.patch new file mode 100644 index 0000000..07dee06 --- /dev/null +++ b/0009-drm-i915-extend-audio-CDCLK-2-BCLK-constraint-to-mor.patch @@ -0,0 +1,41 @@ +From 7ff6d556c831f5f909b3315974816a45a3802670 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Thu, 3 Oct 2019 11:55:31 +0300 +Subject: [PATCH 09/16] drm/i915: extend audio CDCLK>=2*BCLK constraint to more + platforms + +The CDCLK>=2*BCLK constraint applies to all generations since gen10. +Extend the constraint logic in audio get/put_power(). + +Signed-off-by: Kai Vehmanen +Signed-off-by: Jani Nikula +Link: https://patchwork.freedesktop.org/patch/msgid/20191003085531.30990-2-kai.vehmanen@linux.intel.com +--- + drivers/gpu/drm/i915/display/intel_audio.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c +index 440b33762fef..05ef43b13d1c 100644 +--- a/drivers/gpu/drm/i915/display/intel_audio.c ++++ b/drivers/gpu/drm/i915/display/intel_audio.c +@@ -858,7 +858,7 @@ static unsigned long i915_audio_component_get_power(struct device *kdev) + } + + /* Force CDCLK to 2*BCLK as long as we need audio powered. */ +- if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)) ++ if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) + glk_force_audio_cdclk(dev_priv, true); + + if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) +@@ -877,7 +877,7 @@ static void i915_audio_component_put_power(struct device *kdev, + + /* Stop forcing CDCLK to 2*BCLK if no need for audio to be powered. */ + if (--dev_priv->audio_power_refcount == 0) +- if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)) ++ if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) + glk_force_audio_cdclk(dev_priv, false); + + intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO, cookie); +-- +2.25.0 + diff --git a/0010-drm-i915-Limit-audio-CDCLK-2-BCLK-constraint-back-to.patch b/0010-drm-i915-Limit-audio-CDCLK-2-BCLK-constraint-back-to.patch new file mode 100644 index 0000000..edd4404 --- /dev/null +++ b/0010-drm-i915-Limit-audio-CDCLK-2-BCLK-constraint-back-to.patch @@ -0,0 +1,64 @@ +From ce769a8e35537fc71cc9934a1fa39a481f994b25 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 31 Dec 2019 16:00:07 +0200 +Subject: [PATCH 10/16] drm/i915: Limit audio CDCLK>=2*BCLK constraint back to + GLK only + +Revert changes done in commit f6ec9483091f ("drm/i915: extend audio +CDCLK>=2*BCLK constraint to more platforms"). Audio drivers +communicate with i915 over HDA bus multiple times during system +boot-up and each of these transactions result in matching +get_power/put_power calls to i915, and depending on the platform, +a modeset change causing visible flicker. + +GLK is the only platform with minimum CDCLK significantly lower +than BCLK, and thus for GLK setting a higher CDCLK is mandatory. + +For other platforms, minimum CDCLK is close but below 2*BCLK +(e.g. on ICL, CDCLK=176.4kHz with BCLK=96kHz). Spec-wise the constraint +should be set, but in practise no communication errors have been +reported and the downside if set is the flicker observed at boot-time. + +Revert to old behaviour until better mechanism to manage +probe-time clocks is available. + +The full CDCLK>=2*BCLK constraint is still enforced at pipe +enable time in intel_crtc_compute_min_cdclk(). + +Bugzilla: https://gitlab.freedesktop.org/drm/intel/issues/913 +Fixes: f6ec9483091f ("drm/i915: extend audio CDCLK>=2*BCLK constraint to more platforms") +Signed-off-by: Kai Vehmanen +Reviewed-by: Matt Roper +Signed-off-by: Matt Roper +Link: https://patchwork.freedesktop.org/patch/msgid/20191231140007.31728-1-kai.vehmanen@linux.intel.com +(cherry picked from commit 1ee48a61aa57dbdbc3cd2808d8b28df40d938e44) +Signed-off-by: Joonas Lahtinen +--- + drivers/gpu/drm/i915/display/intel_audio.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c +index 05ef43b13d1c..0cf475f3063c 100644 +--- a/drivers/gpu/drm/i915/display/intel_audio.c ++++ b/drivers/gpu/drm/i915/display/intel_audio.c +@@ -858,7 +858,7 @@ static unsigned long i915_audio_component_get_power(struct device *kdev) + } + + /* Force CDCLK to 2*BCLK as long as we need audio powered. */ +- if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) ++ if (IS_GEMINILAKE(dev_priv)) + glk_force_audio_cdclk(dev_priv, true); + + if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) +@@ -877,7 +877,7 @@ static void i915_audio_component_put_power(struct device *kdev, + + /* Stop forcing CDCLK to 2*BCLK if no need for audio to be powered. */ + if (--dev_priv->audio_power_refcount == 0) +- if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) ++ if (IS_GEMINILAKE(dev_priv)) + glk_force_audio_cdclk(dev_priv, false); + + intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO, cookie); +-- +2.25.0 + diff --git a/0010-drm-i915-extend-audio-CDCLK-2BCLK-constraint-to-more-platforms.patch b/0010-drm-i915-extend-audio-CDCLK-2BCLK-constraint-to-more-platforms.patch deleted file mode 100644 index 8d5b9ae..0000000 --- a/0010-drm-i915-extend-audio-CDCLK-2BCLK-constraint-to-more-platforms.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 975d5a884b3c80155808c2ac39e6bb6d51450dea Mon Sep 17 00:00:00 2001 -From: Kai Vehmanen -Date: Thu, 3 Oct 2019 11:55:31 +0300 -Subject: drm/i915: extend audio CDCLK>=2*BCLK constraint to more platforms - -The CDCLK>=2*BCLK constraint applies to all generations since gen10. -Extend the constraint logic in audio get/put_power(). - -Signed-off-by: Kai Vehmanen -Signed-off-by: Jani Nikula -Link: https://patchwork.freedesktop.org/patch/msgid/20191003085531.30990-2-kai.vehmanen@linux.intel.com ---- - drivers/gpu/drm/i915/display/intel_audio.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c -index 440b33762fef..05ef43b13d1c 100644 ---- a/drivers/gpu/drm/i915/display/intel_audio.c -+++ b/drivers/gpu/drm/i915/display/intel_audio.c -@@ -858,7 +858,7 @@ static unsigned long i915_audio_component_get_power(struct device *kdev) - } - - /* Force CDCLK to 2*BCLK as long as we need audio powered. */ -- if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)) -+ if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) - glk_force_audio_cdclk(dev_priv, true); - - if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) -@@ -877,7 +877,7 @@ static void i915_audio_component_put_power(struct device *kdev, - - /* Stop forcing CDCLK to 2*BCLK if no need for audio to be powered. */ - if (--dev_priv->audio_power_refcount == 0) -- if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)) -+ if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) - glk_force_audio_cdclk(dev_priv, false); - - intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO, cookie); --- -cgit v1.2.1-1-g437b - diff --git a/0011-drm-915-Limit-audio-CDCLK-2BCLK-constraint-back-to-GLK-only.patch b/0011-drm-915-Limit-audio-CDCLK-2BCLK-constraint-back-to-GLK-only.patch deleted file mode 100644 index 5c8cbde..0000000 --- a/0011-drm-915-Limit-audio-CDCLK-2BCLK-constraint-back-to-GLK-only.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 238026166679e618b3bad1c86b0e37a43303b6b0 Mon Sep 17 00:00:00 2001 -From: Kai Vehmanen -Date: Tue, 31 Dec 2019 16:00:07 +0200 -Subject: drm/i915: Limit audio CDCLK>=2*BCLK constraint back to GLK only - -Revert changes done in commit f6ec9483091f ("drm/i915: extend audio -CDCLK>=2*BCLK constraint to more platforms"). Audio drivers -communicate with i915 over HDA bus multiple times during system -boot-up and each of these transactions result in matching -get_power/put_power calls to i915, and depending on the platform, -a modeset change causing visible flicker. - -GLK is the only platform with minimum CDCLK significantly lower -than BCLK, and thus for GLK setting a higher CDCLK is mandatory. - -For other platforms, minimum CDCLK is close but below 2*BCLK -(e.g. on ICL, CDCLK=176.4kHz with BCLK=96kHz). Spec-wise the constraint -should be set, but in practise no communication errors have been -reported and the downside if set is the flicker observed at boot-time. - -Revert to old behaviour until better mechanism to manage -probe-time clocks is available. - -The full CDCLK>=2*BCLK constraint is still enforced at pipe -enable time in intel_crtc_compute_min_cdclk(). - -Bugzilla: https://gitlab.freedesktop.org/drm/intel/issues/913 -Fixes: f6ec9483091f ("drm/i915: extend audio CDCLK>=2*BCLK constraint to more platforms") -Signed-off-by: Kai Vehmanen -Reviewed-by: Matt Roper -Signed-off-by: Matt Roper -Link: https://patchwork.freedesktop.org/patch/msgid/20191231140007.31728-1-kai.vehmanen@linux.intel.com -(cherry picked from commit 1ee48a61aa57dbdbc3cd2808d8b28df40d938e44) -Signed-off-by: Joonas Lahtinen ---- - drivers/gpu/drm/i915/display/intel_audio.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c -index 05ef43b13d1c..0cf475f3063c 100644 ---- a/drivers/gpu/drm/i915/display/intel_audio.c -+++ b/drivers/gpu/drm/i915/display/intel_audio.c -@@ -858,7 +858,7 @@ static unsigned long i915_audio_component_get_power(struct device *kdev) - } - - /* Force CDCLK to 2*BCLK as long as we need audio powered. */ -- if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) -+ if (IS_GEMINILAKE(dev_priv)) - glk_force_audio_cdclk(dev_priv, true); - - if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) -@@ -877,7 +877,7 @@ static void i915_audio_component_put_power(struct device *kdev, - - /* Stop forcing CDCLK to 2*BCLK if no need for audio to be powered. */ - if (--dev_priv->audio_power_refcount == 0) -- if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) -+ if (IS_GEMINILAKE(dev_priv)) - glk_force_audio_cdclk(dev_priv, false); - - intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO, cookie); --- -cgit v1.2.1-1-g437b - diff --git a/0011-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-re.patch b/0011-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-re.patch new file mode 100644 index 0000000..13d562a --- /dev/null +++ b/0011-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-re.patch @@ -0,0 +1,35 @@ +From 93ca62c645759168768638e65d52452b4a9898a4 Mon Sep 17 00:00:00 2001 +From: Boyan Ding +Date: Wed, 1 Jan 2020 11:44:49 -0800 +Subject: [PATCH 11/16] pinctrl: sunrisepoint: Add missing Interrupt Status + register offset + +Commit 179e5a6114cc ("pinctrl: intel: Remove default Interrupt Status +offset") removes default interrupt status offset of GPIO controllers, +with previous commits explicitly providing the previously default +offsets. However, the is_offset value in SPTH_COMMUNITY is missing, +preventing related irq from being properly detected and handled. + +Fixes: f702e0b93cdb ("pinctrl: sunrisepoint: Provide Interrupt Status register offset") +Link: https://bugzilla.kernel.org/show_bug.cgi?id=205745 +Cc: stable@vger.kernel.org +Signed-off-by: Boyan Ding +--- + drivers/pinctrl/intel/pinctrl-sunrisepoint.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/pinctrl/intel/pinctrl-sunrisepoint.c b/drivers/pinctrl/intel/pinctrl-sunrisepoint.c +index 44d7f50bbc82..d936e7aa74c4 100644 +--- a/drivers/pinctrl/intel/pinctrl-sunrisepoint.c ++++ b/drivers/pinctrl/intel/pinctrl-sunrisepoint.c +@@ -49,6 +49,7 @@ + .padown_offset = SPT_PAD_OWN, \ + .padcfglock_offset = SPT_PADCFGLOCK, \ + .hostown_offset = SPT_HOSTSW_OWN, \ ++ .is_offset = SPT_GPI_IS, \ + .ie_offset = SPT_GPI_IE, \ + .pin_base = (s), \ + .npins = ((e) - (s) + 1), \ +-- +2.25.0 + diff --git a/0012-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch b/0012-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch new file mode 100644 index 0000000..901b06d --- /dev/null +++ b/0012-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch @@ -0,0 +1,48 @@ +From 540f62738b8f3049e200a086cac75d14d289fae9 Mon Sep 17 00:00:00 2001 +From: Mehmet Akif Tasova +Date: Mon, 30 Dec 2019 15:48:16 +0200 +Subject: [PATCH 12/16] Revert "iwlwifi: mvm: fix scan config command size" + +Since v5.4-rc1 was released, iwlwifi started throwing errors when scan +commands were sent to the firmware with certain devices (depending on +the OTP burned in the device, which contains the list of available +channels). For instance: + +iwlwifi 0000:00:14.3: FW error in SYNC CMD SCAN_CFG_CMD + +This bug was reported in the ArchLinux bug tracker: +https://bugs.archlinux.org/task/64703 + +And also in a specific case in bugzilla, when the lar_disabled option +was set: https://bugzilla.kernel.org/show_bug.cgi?id=205193 + +Revert the commit that introduced this error, by using the number of +channels from the OTP instead of the number of channels that is +specified in the FW TLV that tells us how many channels it supports. + +This reverts commit 06eb547c4ae4382e70d556ba213d13c95ca1801b. + +Cc: stable@vger.kernel.org # v5.4+ +Signed-off-by: Mehmet Akif Tasova +[ Luca: reworded the commit message a bit. ] +Signed-off-by: Luca Coelho +--- + drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +index fcafa22ec6ce..8aa567d7912c 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +@@ -1220,7 +1220,7 @@ static int iwl_mvm_legacy_config_scan(struct iwl_mvm *mvm) + cmd_size = sizeof(struct iwl_scan_config_v2); + else + cmd_size = sizeof(struct iwl_scan_config_v1); +- cmd_size += num_channels; ++ cmd_size += mvm->fw->ucode_capa.n_scan_channels; + + cfg = kzalloc(cmd_size, GFP_KERNEL); + if (!cfg) +-- +2.25.0 + diff --git a/0012-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-register-offset.patch b/0012-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-register-offset.patch deleted file mode 100644 index 64afce3..0000000 --- a/0012-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-register-offset.patch +++ /dev/null @@ -1,34 +0,0 @@ -From adb810e1819b859aec1f8eb4c5611bc6ebe82137 Mon Sep 17 00:00:00 2001 -From: Boyan Ding -Date: Wed, 1 Jan 2020 11:44:49 -0800 -Subject: pinctrl: sunrisepoint: Add missing Interrupt Status register offset - -Commit 179e5a6114cc ("pinctrl: intel: Remove default Interrupt Status -offset") removes default interrupt status offset of GPIO controllers, -with previous commits explicitly providing the previously default -offsets. However, the is_offset value in SPTH_COMMUNITY is missing, -preventing related irq from being properly detected and handled. - -Fixes: f702e0b93cdb ("pinctrl: sunrisepoint: Provide Interrupt Status register offset") -Link: https://bugzilla.kernel.org/show_bug.cgi?id=205745 -Cc: stable@vger.kernel.org -Signed-off-by: Boyan Ding ---- - drivers/pinctrl/intel/pinctrl-sunrisepoint.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/pinctrl/intel/pinctrl-sunrisepoint.c b/drivers/pinctrl/intel/pinctrl-sunrisepoint.c -index 44d7f50bbc82..d936e7aa74c4 100644 ---- a/drivers/pinctrl/intel/pinctrl-sunrisepoint.c -+++ b/drivers/pinctrl/intel/pinctrl-sunrisepoint.c -@@ -49,6 +49,7 @@ - .padown_offset = SPT_PAD_OWN, \ - .padcfglock_offset = SPT_PADCFGLOCK, \ - .hostown_offset = SPT_HOSTSW_OWN, \ -+ .is_offset = SPT_GPI_IS, \ - .ie_offset = SPT_GPI_IE, \ - .pin_base = (s), \ - .npins = ((e) - (s) + 1), \ --- -cgit v1.2.1-1-g437b - diff --git a/0013-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch b/0013-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch deleted file mode 100644 index 5cf14e3..0000000 --- a/0013-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 78fe4d666ff244609c7d02bea07a22ce87e56326 Mon Sep 17 00:00:00 2001 -From: Mehmet Akif Tasova -Date: Mon, 30 Dec 2019 15:48:16 +0200 -Subject: Revert "iwlwifi: mvm: fix scan config command size" - -Since v5.4-rc1 was released, iwlwifi started throwing errors when scan -commands were sent to the firmware with certain devices (depending on -the OTP burned in the device, which contains the list of available -channels). For instance: - -iwlwifi 0000:00:14.3: FW error in SYNC CMD SCAN_CFG_CMD - -This bug was reported in the ArchLinux bug tracker: -https://bugs.archlinux.org/task/64703 - -And also in a specific case in bugzilla, when the lar_disabled option -was set: https://bugzilla.kernel.org/show_bug.cgi?id=205193 - -Revert the commit that introduced this error, by using the number of -channels from the OTP instead of the number of channels that is -specified in the FW TLV that tells us how many channels it supports. - -This reverts commit 06eb547c4ae4382e70d556ba213d13c95ca1801b. - -Cc: stable@vger.kernel.org # v5.4+ -Signed-off-by: Mehmet Akif Tasova -[ Luca: reworded the commit message a bit. ] -Signed-off-by: Luca Coelho ---- - drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c -index fcafa22ec6ce..8aa567d7912c 100644 ---- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c -@@ -1220,7 +1220,7 @@ static int iwl_mvm_legacy_config_scan(struct iwl_mvm *mvm) - cmd_size = sizeof(struct iwl_scan_config_v2); - else - cmd_size = sizeof(struct iwl_scan_config_v1); -- cmd_size += num_channels; -+ cmd_size += mvm->fw->ucode_capa.n_scan_channels; - - cfg = kzalloc(cmd_size, GFP_KERNEL); - if (!cfg) --- -cgit v1.2.1-1-g437b - diff --git a/0013-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch b/0013-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch new file mode 100644 index 0000000..221543b --- /dev/null +++ b/0013-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch @@ -0,0 +1,174 @@ +From cce47515454675d9c82448e865b42570f9eabc39 Mon Sep 17 00:00:00 2001 +From: Jeff Kirsher +Date: Sat, 4 Jan 2020 23:29:22 -0800 +Subject: [PATCH 13/16] e1000e: Revert "e1000e: Make watchdog use delayed work" + +This reverts commit 59653e6497d16f7ac1d9db088f3959f57ee8c3db. + +This is due to this commit causing driver crashes and connections to +reset unexpectedly. + +Signed-off-by: Jeff Kirsher +--- + drivers/net/ethernet/intel/e1000e/e1000.h | 5 +- + drivers/net/ethernet/intel/e1000e/netdev.c | 54 ++++++++++------------ + 2 files changed, 27 insertions(+), 32 deletions(-) + +diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h +index 6c51b1bad8c4..37a2314d3e6b 100644 +--- a/drivers/net/ethernet/intel/e1000e/e1000.h ++++ b/drivers/net/ethernet/intel/e1000e/e1000.h +@@ -185,13 +185,12 @@ struct e1000_phy_regs { + + /* board specific private data structure */ + struct e1000_adapter { ++ struct timer_list watchdog_timer; + struct timer_list phy_info_timer; + struct timer_list blink_timer; + + struct work_struct reset_task; +- struct delayed_work watchdog_task; +- +- struct workqueue_struct *e1000_workqueue; ++ struct work_struct watchdog_task; + + const struct e1000_info *ei; + +diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c +index d7d56e42a6aa..060daf66bf63 100644 +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -1780,8 +1780,7 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data) + } + /* guard against interrupt when we're going down */ + if (!test_bit(__E1000_DOWN, &adapter->state)) +- mod_delayed_work(adapter->e1000_workqueue, +- &adapter->watchdog_task, HZ); ++ mod_timer(&adapter->watchdog_timer, jiffies + 1); + } + + /* Reset on uncorrectable ECC error */ +@@ -1861,8 +1860,7 @@ static irqreturn_t e1000_intr(int __always_unused irq, void *data) + } + /* guard against interrupt when we're going down */ + if (!test_bit(__E1000_DOWN, &adapter->state)) +- mod_delayed_work(adapter->e1000_workqueue, +- &adapter->watchdog_task, HZ); ++ mod_timer(&adapter->watchdog_timer, jiffies + 1); + } + + /* Reset on uncorrectable ECC error */ +@@ -1907,8 +1905,7 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data) + hw->mac.get_link_status = true; + /* guard against interrupt when we're going down */ + if (!test_bit(__E1000_DOWN, &adapter->state)) +- mod_delayed_work(adapter->e1000_workqueue, +- &adapter->watchdog_task, HZ); ++ mod_timer(&adapter->watchdog_timer, jiffies + 1); + } + + if (!test_bit(__E1000_DOWN, &adapter->state)) +@@ -4281,6 +4278,7 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset) + + napi_synchronize(&adapter->napi); + ++ del_timer_sync(&adapter->watchdog_timer); + del_timer_sync(&adapter->phy_info_timer); + + spin_lock(&adapter->stats64_lock); +@@ -5152,11 +5150,25 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter) + } + } + ++/** ++ * e1000_watchdog - Timer Call-back ++ * @data: pointer to adapter cast into an unsigned long ++ **/ ++static void e1000_watchdog(struct timer_list *t) ++{ ++ struct e1000_adapter *adapter = from_timer(adapter, t, watchdog_timer); ++ ++ /* Do the rest outside of interrupt context */ ++ schedule_work(&adapter->watchdog_task); ++ ++ /* TODO: make this use queue_delayed_work() */ ++} ++ + static void e1000_watchdog_task(struct work_struct *work) + { + struct e1000_adapter *adapter = container_of(work, + struct e1000_adapter, +- watchdog_task.work); ++ watchdog_task); + struct net_device *netdev = adapter->netdev; + struct e1000_mac_info *mac = &adapter->hw.mac; + struct e1000_phy_info *phy = &adapter->hw.phy; +@@ -5404,9 +5416,8 @@ static void e1000_watchdog_task(struct work_struct *work) + + /* Reset the timer */ + if (!test_bit(__E1000_DOWN, &adapter->state)) +- queue_delayed_work(adapter->e1000_workqueue, +- &adapter->watchdog_task, +- round_jiffies(2 * HZ)); ++ mod_timer(&adapter->watchdog_timer, ++ round_jiffies(jiffies + 2 * HZ)); + } + + #define E1000_TX_FLAGS_CSUM 0x00000001 +@@ -7259,21 +7270,11 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + goto err_eeprom; + } + +- adapter->e1000_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, +- e1000e_driver_name); +- +- if (!adapter->e1000_workqueue) { +- err = -ENOMEM; +- goto err_workqueue; +- } +- +- INIT_DELAYED_WORK(&adapter->watchdog_task, e1000_watchdog_task); +- queue_delayed_work(adapter->e1000_workqueue, &adapter->watchdog_task, +- 0); +- ++ timer_setup(&adapter->watchdog_timer, e1000_watchdog, 0); + timer_setup(&adapter->phy_info_timer, e1000_update_phy_info, 0); + + INIT_WORK(&adapter->reset_task, e1000_reset_task); ++ INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task); + INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround); + INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task); + INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang); +@@ -7367,9 +7368,6 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + return 0; + + err_register: +- flush_workqueue(adapter->e1000_workqueue); +- destroy_workqueue(adapter->e1000_workqueue); +-err_workqueue: + if (!(adapter->flags & FLAG_HAS_AMT)) + e1000e_release_hw_control(adapter); + err_eeprom: +@@ -7416,17 +7414,15 @@ static void e1000_remove(struct pci_dev *pdev) + */ + if (!down) + set_bit(__E1000_DOWN, &adapter->state); ++ del_timer_sync(&adapter->watchdog_timer); + del_timer_sync(&adapter->phy_info_timer); + + cancel_work_sync(&adapter->reset_task); ++ cancel_work_sync(&adapter->watchdog_task); + cancel_work_sync(&adapter->downshift_task); + cancel_work_sync(&adapter->update_phy_task); + cancel_work_sync(&adapter->print_hang_task); + +- cancel_delayed_work(&adapter->watchdog_task); +- flush_workqueue(adapter->e1000_workqueue); +- destroy_workqueue(adapter->e1000_workqueue); +- + if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) { + cancel_work_sync(&adapter->tx_hwtstamp_work); + if (adapter->tx_hwtstamp_skb) { +-- +2.25.0 + diff --git a/0014-drm-amdgpu-Add-DC-feature-mask-to-disable-fractional.patch b/0014-drm-amdgpu-Add-DC-feature-mask-to-disable-fractional.patch new file mode 100644 index 0000000..a120391 --- /dev/null +++ b/0014-drm-amdgpu-Add-DC-feature-mask-to-disable-fractional.patch @@ -0,0 +1,80 @@ +From f247d4a6fe42acc60b775457e3c35b8289532590 Mon Sep 17 00:00:00 2001 +From: Leo Li +Date: Mon, 21 Oct 2019 14:58:47 -0400 +Subject: [PATCH 14/16] drm/amdgpu: Add DC feature mask to disable fractional + pwm +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[Why] + +Some LED panel drivers might not like fractional PWM. In such cases, +backlight flickering may be observed. + +[How] + +Add a DC feature mask to disable fractional PWM, and associate it with +the preexisting dc_config flag. + +The flag is only plumbed through the dmcu firmware, so plumb it through +the driver path as well. + +To disable, add the following to the linux cmdline: +amdgpu.dcfeaturemask=0x4 + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204957 +Signed-off-by: Leo Li +Reviewed-by: Anthony Koo +Tested-by: Lukáš Krejčí +Signed-off-by: Alex Deucher +--- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ + drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 4 ++++ + drivers/gpu/drm/amd/include/amd_shared.h | 1 + + 3 files changed, 8 insertions(+) + +diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +index 4e9c15c409ba..25b72eb76add 100644 +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +@@ -697,6 +697,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) + if (amdgpu_dc_feature_mask & DC_MULTI_MON_PP_MCLK_SWITCH_MASK) + init_data.flags.multi_mon_pp_mclk_switch = true; + ++ if (amdgpu_dc_feature_mask & DC_DISABLE_FRACTIONAL_PWM_MASK) ++ init_data.flags.disable_fractional_pwm = true; ++ + init_data.flags.power_down_display_on_boot = true; + + #ifdef CONFIG_DRM_AMD_DC_DCN2_0 +diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +index 7700a855d77c..698b84acc44f 100644 +--- a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c ++++ b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +@@ -404,6 +404,10 @@ static bool dce_abm_init_backlight(struct abm *abm) + /* Enable the backlight output */ + REG_UPDATE(BL_PWM_CNTL, BL_PWM_EN, 1); + ++ /* Disable fractional pwm if configured */ ++ REG_UPDATE(BL_PWM_CNTL, BL_PWM_FRACTIONAL_EN, ++ abm->ctx->dc->config.disable_fractional_pwm ? 0 : 1); ++ + /* Unlock group 2 backlight registers */ + REG_UPDATE(BL_PWM_GRP1_REG_LOCK, + BL_PWM_GRP1_REG_LOCK, 0); +diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h +index 8889aaceec60..5450ed762b7a 100644 +--- a/drivers/gpu/drm/amd/include/amd_shared.h ++++ b/drivers/gpu/drm/amd/include/amd_shared.h +@@ -143,6 +143,7 @@ enum PP_FEATURE_MASK { + enum DC_FEATURE_MASK { + DC_FBC_MASK = 0x1, + DC_MULTI_MON_PP_MCLK_SWITCH_MASK = 0x2, ++ DC_DISABLE_FRACTIONAL_PWM_MASK = 0x4, + }; + + enum amd_dpm_forced_level; +-- +2.25.0 + diff --git a/0014-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch b/0014-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch deleted file mode 100644 index 52e42b2..0000000 --- a/0014-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch +++ /dev/null @@ -1,174 +0,0 @@ -From 195bb1762da1aa1c1beffe402353afd619ea7338 Mon Sep 17 00:00:00 2001 -From: Jeff Kirsher -Date: Sat, 4 Jan 2020 23:29:22 -0800 -Subject: e1000e: Revert "e1000e: Make watchdog use delayed work" - -This reverts commit 59653e6497d16f7ac1d9db088f3959f57ee8c3db. - -This is due to this commit causing driver crashes and connections to -reset unexpectedly. - -Signed-off-by: Jeff Kirsher ---- - drivers/net/ethernet/intel/e1000e/e1000.h | 5 ++- - drivers/net/ethernet/intel/e1000e/netdev.c | 54 ++++++++++++++---------------- - 2 files changed, 27 insertions(+), 32 deletions(-) - -diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h -index 6c51b1bad8c4..37a2314d3e6b 100644 ---- a/drivers/net/ethernet/intel/e1000e/e1000.h -+++ b/drivers/net/ethernet/intel/e1000e/e1000.h -@@ -185,13 +185,12 @@ struct e1000_phy_regs { - - /* board specific private data structure */ - struct e1000_adapter { -+ struct timer_list watchdog_timer; - struct timer_list phy_info_timer; - struct timer_list blink_timer; - - struct work_struct reset_task; -- struct delayed_work watchdog_task; -- -- struct workqueue_struct *e1000_workqueue; -+ struct work_struct watchdog_task; - - const struct e1000_info *ei; - -diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c -index d7d56e42a6aa..060daf66bf63 100644 ---- a/drivers/net/ethernet/intel/e1000e/netdev.c -+++ b/drivers/net/ethernet/intel/e1000e/netdev.c -@@ -1780,8 +1780,7 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data) - } - /* guard against interrupt when we're going down */ - if (!test_bit(__E1000_DOWN, &adapter->state)) -- mod_delayed_work(adapter->e1000_workqueue, -- &adapter->watchdog_task, HZ); -+ mod_timer(&adapter->watchdog_timer, jiffies + 1); - } - - /* Reset on uncorrectable ECC error */ -@@ -1861,8 +1860,7 @@ static irqreturn_t e1000_intr(int __always_unused irq, void *data) - } - /* guard against interrupt when we're going down */ - if (!test_bit(__E1000_DOWN, &adapter->state)) -- mod_delayed_work(adapter->e1000_workqueue, -- &adapter->watchdog_task, HZ); -+ mod_timer(&adapter->watchdog_timer, jiffies + 1); - } - - /* Reset on uncorrectable ECC error */ -@@ -1907,8 +1905,7 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data) - hw->mac.get_link_status = true; - /* guard against interrupt when we're going down */ - if (!test_bit(__E1000_DOWN, &adapter->state)) -- mod_delayed_work(adapter->e1000_workqueue, -- &adapter->watchdog_task, HZ); -+ mod_timer(&adapter->watchdog_timer, jiffies + 1); - } - - if (!test_bit(__E1000_DOWN, &adapter->state)) -@@ -4281,6 +4278,7 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset) - - napi_synchronize(&adapter->napi); - -+ del_timer_sync(&adapter->watchdog_timer); - del_timer_sync(&adapter->phy_info_timer); - - spin_lock(&adapter->stats64_lock); -@@ -5152,11 +5150,25 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter) - } - } - -+/** -+ * e1000_watchdog - Timer Call-back -+ * @data: pointer to adapter cast into an unsigned long -+ **/ -+static void e1000_watchdog(struct timer_list *t) -+{ -+ struct e1000_adapter *adapter = from_timer(adapter, t, watchdog_timer); -+ -+ /* Do the rest outside of interrupt context */ -+ schedule_work(&adapter->watchdog_task); -+ -+ /* TODO: make this use queue_delayed_work() */ -+} -+ - static void e1000_watchdog_task(struct work_struct *work) - { - struct e1000_adapter *adapter = container_of(work, - struct e1000_adapter, -- watchdog_task.work); -+ watchdog_task); - struct net_device *netdev = adapter->netdev; - struct e1000_mac_info *mac = &adapter->hw.mac; - struct e1000_phy_info *phy = &adapter->hw.phy; -@@ -5404,9 +5416,8 @@ link_up: - - /* Reset the timer */ - if (!test_bit(__E1000_DOWN, &adapter->state)) -- queue_delayed_work(adapter->e1000_workqueue, -- &adapter->watchdog_task, -- round_jiffies(2 * HZ)); -+ mod_timer(&adapter->watchdog_timer, -+ round_jiffies(jiffies + 2 * HZ)); - } - - #define E1000_TX_FLAGS_CSUM 0x00000001 -@@ -7259,21 +7270,11 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) - goto err_eeprom; - } - -- adapter->e1000_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, -- e1000e_driver_name); -- -- if (!adapter->e1000_workqueue) { -- err = -ENOMEM; -- goto err_workqueue; -- } -- -- INIT_DELAYED_WORK(&adapter->watchdog_task, e1000_watchdog_task); -- queue_delayed_work(adapter->e1000_workqueue, &adapter->watchdog_task, -- 0); -- -+ timer_setup(&adapter->watchdog_timer, e1000_watchdog, 0); - timer_setup(&adapter->phy_info_timer, e1000_update_phy_info, 0); - - INIT_WORK(&adapter->reset_task, e1000_reset_task); -+ INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task); - INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround); - INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task); - INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang); -@@ -7367,9 +7368,6 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) - return 0; - - err_register: -- flush_workqueue(adapter->e1000_workqueue); -- destroy_workqueue(adapter->e1000_workqueue); --err_workqueue: - if (!(adapter->flags & FLAG_HAS_AMT)) - e1000e_release_hw_control(adapter); - err_eeprom: -@@ -7416,17 +7414,15 @@ static void e1000_remove(struct pci_dev *pdev) - */ - if (!down) - set_bit(__E1000_DOWN, &adapter->state); -+ del_timer_sync(&adapter->watchdog_timer); - del_timer_sync(&adapter->phy_info_timer); - - cancel_work_sync(&adapter->reset_task); -+ cancel_work_sync(&adapter->watchdog_task); - cancel_work_sync(&adapter->downshift_task); - cancel_work_sync(&adapter->update_phy_task); - cancel_work_sync(&adapter->print_hang_task); - -- cancel_delayed_work(&adapter->watchdog_task); -- flush_workqueue(adapter->e1000_workqueue); -- destroy_workqueue(adapter->e1000_workqueue); -- - if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) { - cancel_work_sync(&adapter->tx_hwtstamp_work); - if (adapter->tx_hwtstamp_skb) { --- -cgit v1.2.1-1-g437b - diff --git a/0015-ptp-free-ptp-device-pin-descriptors-properly.patch b/0015-ptp-free-ptp-device-pin-descriptors-properly.patch new file mode 100644 index 0000000..6298fa4 --- /dev/null +++ b/0015-ptp-free-ptp-device-pin-descriptors-properly.patch @@ -0,0 +1,50 @@ +From b89e9f6a3ec61a96b5abced31813ad043bda3827 Mon Sep 17 00:00:00 2001 +From: Vladis Dronov +Date: Mon, 13 Jan 2020 14:00:09 +0100 +Subject: [PATCH 15/16] ptp: free ptp device pin descriptors properly + +There is a bug in ptp_clock_unregister(), where ptp_cleanup_pin_groups() +first frees ptp->pin_{,dev_}attr, but then posix_clock_unregister() needs +them to destroy a related sysfs device. + +These functions can not be just swapped, as posix_clock_unregister() frees +ptp which is needed in the ptp_cleanup_pin_groups(). Fix this by calling +ptp_cleanup_pin_groups() in ptp_clock_release(), right before ptp is freed. + +This makes this patch fix an UAF bug in a patch which fixes an UAF bug. + +Reported-by: Antti Laakso +Fixes: a33121e5487b ("ptp: fix the race between the release of ptp_clock and cdev") +Link: https://lore.kernel.org/netdev/3d2bd09735dbdaf003585ca376b7c1e5b69a19bd.camel@intel.com/ +Signed-off-by: Vladis Dronov +Acked-by: Richard Cochran +--- + drivers/ptp/ptp_clock.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c +index 61fafe0374ce..b84f16bbd6f2 100644 +--- a/drivers/ptp/ptp_clock.c ++++ b/drivers/ptp/ptp_clock.c +@@ -170,6 +170,7 @@ static void ptp_clock_release(struct device *dev) + { + struct ptp_clock *ptp = container_of(dev, struct ptp_clock, dev); + ++ ptp_cleanup_pin_groups(ptp); + mutex_destroy(&ptp->tsevq_mux); + mutex_destroy(&ptp->pincfg_mux); + ida_simple_remove(&ptp_clocks_map, ptp->index); +@@ -302,9 +303,8 @@ int ptp_clock_unregister(struct ptp_clock *ptp) + if (ptp->pps_source) + pps_unregister_source(ptp->pps_source); + +- ptp_cleanup_pin_groups(ptp); +- + posix_clock_unregister(&ptp->clock); ++ + return 0; + } + EXPORT_SYMBOL(ptp_clock_unregister); +-- +2.25.0 + diff --git a/PKGBUILD b/PKGBUILD index cb56821..274b3e8 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -17,7 +17,7 @@ pkgbase=linux-ck _supver=5 _majver=4 -_minver=12 +_minver=13 _gccpatchver='20190822' _ckpatchversion=ck1 if [ "$_minver" == "0" ]; then @@ -39,20 +39,21 @@ options=('!strip') _srcname=linux-${pkgver} source=( https://www.kernel.org/pub/linux/kernel/v${_supver}.x/${_srcname}.tar.{xz,sign} - 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch + 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch 0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch 0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch - 0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch - 0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch - 0006-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch - 0007-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch - 0008-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-suspend.patch - 0009-drm-i915-Fix-audio-power-up-sequence-for-gen10-display.patch - 0010-drm-i915-extend-audio-CDCLK-2BCLK-constraint-to-more-platforms.patch - 0011-drm-915-Limit-audio-CDCLK-2BCLK-constraint-back-to-GLK-only.patch - 0012-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-register-offset.patch - 0013-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch - 0014-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch + 0004-PCI-pciehp-Prevent-deadlock-on-disconnect.patch + 0005-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch + 0006-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch + 0007-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-s.patch + 0008-drm-i915-Fix-audio-power-up-sequence-for-gen10-displ.patch + 0009-drm-i915-extend-audio-CDCLK-2-BCLK-constraint-to-mor.patch + 0010-drm-i915-Limit-audio-CDCLK-2-BCLK-constraint-back-to.patch + 0011-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-re.patch + 0012-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch + 0013-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch + 0014-drm-amdgpu-Add-DC-feature-mask-to-disable-fractional.patch + 0015-ptp-free-ptp-device-pin-descriptors-properly.patch linux-ck-patch-${_supver}.${_majver}-${_ckpatchversion}.xz::http://ck.kolivas.org/patches/${_supver}.0/${_supver}.${_majver}/${_supver}.${_majver}-${_ckpatchversion}/patch-${_supver}.${_majver}-${_ckpatchversion}.xz graysky_bdver2-hotfix.patch kernel_gcc_patch-${_gccpatchver}.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/${_gccpatchver}.tar.gz @@ -65,28 +66,29 @@ validpgpkeys=( '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman ) # https://www.kernel.org/pub/linux/kernel/v5.x/sha256sums.asc -b2sums=('f08d30011b2021724a240f45a4d0a92ba01b97d0d2d33ce0d88aeb6dfb0a2e5a532fd55ad0a2ef0e3ec160cb23b351a09b494382e80b0db85bcfe7cfeaa554dd' +b2sums=('d610a2bf375c9147b26d6e314c1e86b9f32453572c1e8a859be3ac5fa42d7ba647334ef76a92a7e1e61f78fa256692bec3d62003589017840a37947d9d5b1de0' 'SKIP' - '8e25246725016ac6a1452592b092616aacba744ee6d1f87355b141011e31d91b2faca01494930a8bb4b816f92f86929098cc60bf786bdc68513e7bc572b06226' - '0e4e01200c6250c6d251d2cb38889e9f488e07b1014ea8c8f81182457cf057ce444b14e21afc786671115ec0b100e3ce9b32a5785c2b0b07b11d956887f477d3' - 'd3b62df935c6f5379b4c11f455a7231ffbab58857bdd650256499a702e54aaa729348054beb7742b90f145893622538aa4345c117238d46687ef6d07d62655da' - 'f2d71e3652594d7c23c87a952c40a3c2d394f6a621dce6a19a0463108695c55f5505d9526abb5283b74e3f84ae51283aeaf0e76a78e8e0133b0b07828def1d1d' - 'bf786a19dd0cc8572880f8339711fa173219b2cb9f44b2a4e48591671770c075706ea6db673ddd2cd49d42bdb2723e0161a704f77c761df5fdf31b033f45b6a0' - '8083144de9dcf8750a502589625d6d16c2316dfb01dddf6b502dbcf5d1632822ed1cee05e5eb0ecf58cd88726cda84b0ea493c1ab6df3a862886756aa78d540a' - '7a9081dee4774f8b2f51dcd980bfcd085ead77fb07915026044792bdf1c8831626173471a2c2cac0e1420fe7f23954b9101eab4884c78c33115f096cd5f560e9' - 'f28183f6fd07ba0e6787e935d56dd683435e0bdd6e04cba717aa5b0da093d40a79a422f3398b813e41d70411cbd664045518050fd9b61a0350e75e36e747c345' - '7fc476dc0fef4d0a11c3f04c33a0350eae87115dcafcfb96a453112041ba88e1cf5a3535c95069568c849f04c356e2bde0686c8e5ba25be7a781b775f808a43c' - '9d1ad2023e9ffc92a4ccb6194a858267fbb6286c13784b8b8a2af3d5814abd0e4229409489f8a6bea5157193324dba58553ba03229169809bec73a8cc59c26ba' - '7d6e7b7c2791971de427b346732c3fa345635db68c84c0b1ac736862fc62da61516975ccd78b28d3df50967d8ae1fe6b3251383733f797c19c1671b8b8a5aa42' - '782f41ae6352cfc1c47ed54eddcded54969c7d43a326dc2d6593b373b4dc4672bc82a6d938090635dc02ef3b3b74e133a2170c7f9c6fd614641c7cb3b013ff2e' - 'ae21b49fe1c6fef81aa93282d0a242c196a0378256e890013a05d4e2f3b79ad92526bd1088ab6e44fba511abeabcb328ef58907ab03214d21d2fb88ea702f3e0' - 'e1da80f3c9197e62223398b717e0c3ecfcdc7f33fa6477a9e8634ae806823c208bd5e05401a0b72a506d8e1df5a5cdf6624ff88926e7042156ee0fb6278e3ca3' + '76c34ea8f8d6fafcbb12fa0e01821af5926e60046c37cee9855786b8bfe16b8ac5222d441335aa01b62e7ebfe2805a1175d00d3bc4ee1c2617173934284c4164' + '5427a9283a9ccb38a63ba5bd680e331245bd134501ce66e912cb07c250e37810a895f4ae78371db2b0cfcbfcb1bee96daafc0e5c71f40ec9b8643d3a88a80bab' + 'fab987c7c77e07ae2db83d148e8d423e6aadbcfc84498a60a6396418c69108c0a38a426eca57c1e94f2540f25cbcd084eafe3d124ac9d0ce2ab4efff28852a16' + 'c5cd99138e9436ede9136e5f958a15a10e07ab51e77dc716158b1ff774d9fa06f4ec2b7a1ba171f4ea86c16ea61fb685b54cadb85411b1c7c468d984b495585d' + 'd283a69b0577dda72ae5814b3c681ca5f0655692216ce77cccc909903fda037feae35fc545c6d54daa377edb71895cfc4f199a335f3f4dfda3cde90350a627b3' + '2328a9bddbb712ffe587a2266d9c6074b4a9e1273b4546e86c56b26dcd7c509398a3e428e6292999bb0297f135683793fa28acfbc4d744962e2ca396943d9ddb' + 'a7318e80116cecfe0c31e254c6d52706ce56d202064d9ff851506569ad602ed106bce216facf793a27266a58b372092e5fa4a19b7b4a7380a789874066d91852' + 'ab7c15c8a219a7e895b39a10a452005252bb018749607676a7e436263a0876d096a5716c9bcbf30e2ff6bc4e525be22ac3838ab3d363373945d5bf5ce43648d4' + 'bb35fce00e121769f4a85c01a799efa7e3eccae8fdd29993d5bbd574a2af50cabeafcf6a9bebf5713223cdb64a53fd7bbf41de7f0a84023531b160e0fe88dc52' + '26082d1d89d9a6e44ea29be9056029f4af228cf22d6c4f6c9f32ed552859bcb8982dc57f63bcb216e220590a029800aeade0bf47356f7ef3ebbe9c0261674379' + 'aba17d1a3a4638d997c33ea385cfd4ac4008a13f31c026e86342169117aa6b238cdebdc4ddbe234e54c68816386ac0e401ecd9e5b49bd42e1ef60eecdf3ad89a' + 'd4878831fa03c17b590001d15ddbbfeb1a8747c961503c26aee330d213c0fbf6c2eab7226456083f52a5fb4b4ffd9bf7b2db741de7c7476a15873f2a8d9f7b74' + '76bb50a23b822de85f3381a511b42bb46110a39d31ede81bd168cb708882b93be525576b1805da5383f35f6f18fab817ad195aa870ab75e7775855a150d172a1' + '726d89aeb1f5df51cfa395e01edb4b8b36460b1f75611ee921d057dfb28cd2d6c41990bca4b40512b9398e0558c4028845252442d9ec1d8f13847a0ed9903a1d' + '00cfbcf17b5f89a0d69f46ea9487088b49b265d360612a777394c69746e13618aff56240dae754111db901891641925b83a8bb95c85c3ee0c11266611d72145c' '8faff0d2b95eda0b96e8042367634c45c1e823238e99793daeda5614efdc448dfe28172bf13f0d988cf4d5cbb4892089893e0183cd8825de7f54942283f2b5a0' '1892bd22775eac3bcc4d37f4fd30c95346bf3a0888cbbff57fd614973b525390dff2e315ce35b2e498523cceaab94ff21a80475dee8df3de4dd8fc0fab07d74e' '0b11c09e01a7480466d5237a8792c941c9af3e8d6584ffd84285cd9569f5355c10879566ce5846ef9263535020c53e1aa6c58100a571b537ccb7f2431baf7996' '2e58bb89b247b1678355368956e67c1de51fcde97a227b2162f6771e30f17fa5520faafe7be4b6816a542e7ae10d05f64c6b6354f352c12746d4b8da632936dd' 'fde132f3705d908e6f2147c78a2193289916d72304ca5efa2229d79fc3e57a857314ce94e71425caef2f7f7b6cf87f05ef86335dc8bd4be78e7035afe608005a' - 'f01a08c06c2888266e5e5929236ad19d03c650fae09f9794840e52692fb93708a2bf88f3a06b4f0ff1ea57d62d6d06d81e5c4ce52f3b55dae1ae71c8d6b736da') + '58e09bb87b4780228e6c347171f06a854356e9af21d1bbb3b697848a13c0d196fc8863c6b1343e7ee0b87c43e739132cd8978f31b4aaf04da1cee728b9d1236d') #export KBUILD_BUILD_HOST=arc4linux export KBUILD_BUILD_USER=$pkgbase @@ -97,61 +99,63 @@ prepare() { # add upstream patch # if [ "$_minver" != "0" ]; then -# msg2 "Applying upstream patch" +# echo "Applying upstream patch" # patch -Np1 < ../patch-${_supver}.${_majver}-${pkgver} # fi # Hotfixes - msg2 "Applying hotfixes" - patch -p1 -i ../0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch + echo "Applying hotfixes" + patch -p1 -i ../0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch patch -p1 -i ../0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch patch -p1 -i ../0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch - patch -p1 -i ../0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch - patch -p1 -i ../0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch - patch -p1 -i ../0006-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch - patch -p1 -i ../0007-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch - patch -p1 -i ../0008-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-suspend.patch - patch -p1 -i ../0009-drm-i915-Fix-audio-power-up-sequence-for-gen10-display.patch - patch -p1 -i ../0010-drm-i915-extend-audio-CDCLK-2BCLK-constraint-to-more-platforms.patch - patch -p1 -i ../0011-drm-915-Limit-audio-CDCLK-2BCLK-constraint-back-to-GLK-only.patch - patch -p1 -i ../0012-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-register-offset.patch - patch -p1 -i ../0013-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch - patch -p1 -i ../0014-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch + patch -p1 -i ../0004-PCI-pciehp-Prevent-deadlock-on-disconnect.patch + patch -p1 -i ../0005-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch + patch -p1 -i ../0006-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch + patch -p1 -i ../0007-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-s.patch + patch -p1 -i ../0008-drm-i915-Fix-audio-power-up-sequence-for-gen10-displ.patch + patch -p1 -i ../0009-drm-i915-extend-audio-CDCLK-2-BCLK-constraint-to-mor.patch + patch -p1 -i ../0010-drm-i915-Limit-audio-CDCLK-2-BCLK-constraint-back-to.patch + patch -p1 -i ../0011-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-re.patch + patch -p1 -i ../0012-Revert-iwlwifi-mvm-fix-scan-config-command-size.patch + patch -p1 -i ../0013-e1000e-Revert-e1000e-Make-watchdog-use-delayed-work.patch + patch -p1 -i ../0014-drm-amdgpu-Add-DC-feature-mask-to-disable-fractional.patch + patch -p1 -i ../0015-ptp-free-ptp-device-pin-descriptors-properly.patch + # fix naming schema in EXTRAVERSION of ck patch set sed -i -re "s/^(.EXTRAVERSION).*$/\1 = /" "../linux-ck-patch-${_supver}.${_majver}-${_ckpatchversion}" # ck patch - msg2 "Applying ck patch" + echo "Applying ck patch" patch -F 3 -Np1 -i ../linux-ck-patch-${_supver}.${_majver}-${_ckpatchversion} # graysky gcc hotfixes - msg2 "Applying graysky gcc patch hotfixes" + echo "Applying graysky gcc patch hotfixes" patch -p1 -i ../graysky_bdver2-hotfix.patch "$srcdir/kernel_gcc_patch-${_gccpatchver}/enable_additional_cpu_optimizations_for_gcc_v9.1+_kernel_v4.13+.patch" # graysky gcc patch - msg2 "Applying graysky cpu patch" + echo "Applying graysky cpu patch" patch -p1 -i ../kernel_gcc_patch-${_gccpatchver}/enable_additional_cpu_optimizations_for_gcc_v9.1+_kernel_v4.13+.patch # Ignore ath9k eeprom patch - msg2 "Applying ath9k patch" + echo "Applying ath9k patch" patch -p1 -i ../ath9k-regdom-hack.patch # Set default raid6 algo patch - msg2 " Applying raid6 patch" + echo " Applying raid6 patch" patch -p1 -i ../raid6-default-algo.patch - msg2 "Setting version..." + echo "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname - msg2 "Setting config..." + echo "Setting config..." # we are in src/linux-x.yy.zz, looking for a config next to the pkgbuild if [ -f ${SRCDEST}/config.ck.previous ]; then cp ${SRCDEST}/config.ck.previous .config @@ -162,7 +166,7 @@ prepare() { make olddefconfig if [ -f $HOME/.config/modprobed.db ]; then - msg2 "Running make localmodconfig" + echo "Running make localmodconfig" make LSMOD=$HOME/.config/modprobed.db localmodconfig fi @@ -185,10 +189,10 @@ prepare() { cat ../version.temp | tr -d "\n" > version # back up the config - msg2 "Backing up config..." + echo "Backing up config..." cp .config ${SRCDEST}/config.ck.previous - msg2 "Prepared %s version %s" "$pkgbase" "$(