From: Sasha Levin Date: Thu, 2 Apr 2020 21:35:21 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v5.4.31~47^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42cb8eecdeb311bbd9cf2e7b1e105f53a3a2ca49;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/drm-amd-display-add-link_rate-quirk-for-apple-15-mbp.patch b/queue-4.19/drm-amd-display-add-link_rate-quirk-for-apple-15-mbp.patch new file mode 100644 index 00000000000..59571ab4d7e --- /dev/null +++ b/queue-4.19/drm-amd-display-add-link_rate-quirk-for-apple-15-mbp.patch @@ -0,0 +1,67 @@ +From 5aa5630af2fdb3296d99b3471ad4b1233bfb2113 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 28 Feb 2020 22:36:07 +0100 +Subject: drm/amd/display: Add link_rate quirk for Apple 15" MBP 2017 + +From: Mario Kleiner + +[ Upstream commit dec9de2ada523b344eb2428abfedf9d6cd0a0029 ] + +This fixes a problem found on the MacBookPro 2017 Retina panel: + +The panel reports 10 bpc color depth in its EDID, and the +firmware chooses link settings at boot which support enough +bandwidth for 10 bpc (324000 kbit/sec aka LINK_RATE_RBR2 +aka 0xc), but the DP_MAX_LINK_RATE dpcd register only reports +2.7 Gbps (multiplier value 0xa) as possible, in direct +contradiction of what the firmware successfully set up. + +This restricts the panel to 8 bpc, not providing the full +color depth of the panel on Linux <= 5.5. Additionally, commit +'4a8ca46bae8a ("drm/amd/display: Default max bpc to 16 for eDP")' +introduced into Linux 5.6-rc1 will unclamp panel depth to +its full 10 bpc, thereby requiring a eDP bandwidth for all +modes that exceeds the bandwidth available and causes all modes +to fail validation -> No modes for the laptop panel -> failure +to set any mode -> Panel goes dark. + +This patch adds a quirk specific to the MBP 2017 15" Retina +panel to override reported max link rate to the correct maximum +of 0xc = LINK_RATE_RBR2 to fix the darkness and reduced display +precision. + +Please apply for Linux 5.6+ to avoid regressing Apple MBP panel +support. + +Signed-off-by: Mario Kleiner +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +index 122249da03ab7..a4928854a3de5 100644 +--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c ++++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +@@ -2440,6 +2440,17 @@ static bool retrieve_link_cap(struct dc_link *link) + sink_id.ieee_device_id, + sizeof(sink_id.ieee_device_id)); + ++ /* Quirk Apple MBP 2017 15" Retina panel: Wrong DP_MAX_LINK_RATE */ ++ { ++ uint8_t str_mbp_2017[] = { 101, 68, 21, 101, 98, 97 }; ++ ++ if ((link->dpcd_caps.sink_dev_id == 0x0010fa) && ++ !memcmp(link->dpcd_caps.sink_dev_id_str, str_mbp_2017, ++ sizeof(str_mbp_2017))) { ++ link->reported_link_cap.link_rate = 0x0c; ++ } ++ } ++ + core_link_read_dpcd( + link, + DP_SINK_HW_REVISION_START, +-- +2.20.1 + diff --git a/queue-4.19/drm-amdgpu-fix-typo-for-vcn1-idle-check.patch b/queue-4.19/drm-amdgpu-fix-typo-for-vcn1-idle-check.patch new file mode 100644 index 00000000000..9d9dfc888df --- /dev/null +++ b/queue-4.19/drm-amdgpu-fix-typo-for-vcn1-idle-check.patch @@ -0,0 +1,35 @@ +From a7f0aafc7015d598b2405d91aec36bec1746bde6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Mar 2020 17:09:05 -0400 +Subject: drm/amdgpu: fix typo for vcn1 idle check + +From: James Zhu + +[ Upstream commit acfc62dc68770aa665cc606891f6df7d6d1e52c0 ] + +fix typo for vcn1 idle check + +Signed-off-by: James Zhu +Reviewed-by: Leo Liu +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +index 4f8f3bb218320..a54f8943ffa34 100644 +--- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +@@ -857,7 +857,7 @@ static int vcn_v1_0_set_clockgating_state(void *handle, + + if (enable) { + /* wait for STATUS to clear */ +- if (vcn_v1_0_is_idle(handle)) ++ if (!vcn_v1_0_is_idle(handle)) + return -EBUSY; + vcn_v1_0_enable_clock_gating(adev); + } else { +-- +2.20.1 + diff --git a/queue-4.19/drm-bochs-downgrade-pci_request_region-failure-from-.patch b/queue-4.19/drm-bochs-downgrade-pci_request_region-failure-from-.patch new file mode 100644 index 00000000000..48db205351c --- /dev/null +++ b/queue-4.19/drm-bochs-downgrade-pci_request_region-failure-from-.patch @@ -0,0 +1,48 @@ +From d0e85d9792bfc778dd388b3afc36fbf454b1d32e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 13 Mar 2020 09:41:52 +0100 +Subject: drm/bochs: downgrade pci_request_region failure from error to warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Gerd Hoffmann + +[ Upstream commit 8c34cd1a7f089dc03933289c5d4a4d1489549828 ] + +Shutdown of firmware framebuffer has a bunch of problems. Because +of this the framebuffer region might still be reserved even after +drm_fb_helper_remove_conflicting_pci_framebuffers() returned. + +Don't consider pci_request_region() failure for the framebuffer +region as fatal error to workaround this issue. + +Reported-by: Marek Marczykowski-Górecki +Signed-off-by: Gerd Hoffmann +Acked-by: Sam Ravnborg +Link: http://patchwork.freedesktop.org/patch/msgid/20200313084152.2734-1-kraxel@redhat.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/bochs/bochs_hw.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c +index a39b0343c197d..401c218567af9 100644 +--- a/drivers/gpu/drm/bochs/bochs_hw.c ++++ b/drivers/gpu/drm/bochs/bochs_hw.c +@@ -97,10 +97,8 @@ int bochs_hw_init(struct drm_device *dev, uint32_t flags) + size = min(size, mem); + } + +- if (pci_request_region(pdev, 0, "bochs-drm") != 0) { +- DRM_ERROR("Cannot request framebuffer\n"); +- return -EBUSY; +- } ++ if (pci_request_region(pdev, 0, "bochs-drm") != 0) ++ DRM_WARN("Cannot request framebuffer, boot fb still active?\n"); + + bochs->fb_map = ioremap(addr, size); + if (bochs->fb_map == NULL) { +-- +2.20.1 + diff --git a/queue-4.19/initramfs-restore-default-compression-behavior.patch b/queue-4.19/initramfs-restore-default-compression-behavior.patch new file mode 100644 index 00000000000..c32d1df7ab4 --- /dev/null +++ b/queue-4.19/initramfs-restore-default-compression-behavior.patch @@ -0,0 +1,79 @@ +From 419f7184ce61b1b6ac511b830fce2a14a78fce79 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 16 Mar 2020 14:25:19 +0300 +Subject: initramfs: restore default compression behavior + +From: Eugeniy Paltsev + +[ Upstream commit 785d74ec3bbf26ac7f6e92e6e96a259aec0f107a ] + +Even though INITRAMFS_SOURCE kconfig option isn't set in most of +defconfigs it is used (set) extensively by various build systems. +Commit f26661e12765 ("initramfs: make initramfs compression choice +non-optional") has changed default compression mode. Previously we +compress initramfs using available compression algorithm. Now +we don't use any compression at all by default. +It significantly increases the image size in case of build system +chooses embedded initramfs. Initially I faced with this issue while +using buildroot. + +As of today it's not possible to set preferred compression mode +in target defconfig as this option depends on INITRAMFS_SOURCE +being set. Modification of all build systems either doesn't look +like good option. + +Let's instead rewrite initramfs compression mode choices list +the way that "INITRAMFS_COMPRESSION_NONE" will be the last option +in the list. In that case it will be chosen only if all other +options (which implements any compression) are not available. + +Signed-off-by: Eugeniy Paltsev +Signed-off-by: Masahiro Yamada +Signed-off-by: Sasha Levin +--- + usr/Kconfig | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/usr/Kconfig b/usr/Kconfig +index 43658b8a975e5..8b4826de1189f 100644 +--- a/usr/Kconfig ++++ b/usr/Kconfig +@@ -131,17 +131,6 @@ choice + + If in doubt, select 'None' + +-config INITRAMFS_COMPRESSION_NONE +- bool "None" +- help +- Do not compress the built-in initramfs at all. This may sound wasteful +- in space, but, you should be aware that the built-in initramfs will be +- compressed at a later stage anyways along with the rest of the kernel, +- on those architectures that support this. However, not compressing the +- initramfs may lead to slightly higher memory consumption during a +- short time at boot, while both the cpio image and the unpacked +- filesystem image will be present in memory simultaneously +- + config INITRAMFS_COMPRESSION_GZIP + bool "Gzip" + depends on RD_GZIP +@@ -214,6 +203,17 @@ config INITRAMFS_COMPRESSION_LZ4 + If you choose this, keep in mind that most distros don't provide lz4 + by default which could cause a build failure. + ++config INITRAMFS_COMPRESSION_NONE ++ bool "None" ++ help ++ Do not compress the built-in initramfs at all. This may sound wasteful ++ in space, but, you should be aware that the built-in initramfs will be ++ compressed at a later stage anyways along with the rest of the kernel, ++ on those architectures that support this. However, not compressing the ++ initramfs may lead to slightly higher memory consumption during a ++ short time at boot, while both the cpio image and the unpacked ++ filesystem image will be present in memory simultaneously ++ + endchoice + + config INITRAMFS_COMPRESSION +-- +2.20.1 + diff --git a/queue-4.19/nvme-rdma-avoid-double-freeing-of-async-event-data.patch b/queue-4.19/nvme-rdma-avoid-double-freeing-of-async-event-data.patch new file mode 100644 index 00000000000..c91e378e4be --- /dev/null +++ b/queue-4.19/nvme-rdma-avoid-double-freeing-of-async-event-data.patch @@ -0,0 +1,56 @@ +From 72bcfd93a5509ef41d2120f894ed583f082ebabe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 9 Mar 2020 15:07:53 -0600 +Subject: nvme-rdma: Avoid double freeing of async event data + +From: Prabhath Sajeepa + +[ Upstream commit 9134ae2a2546cb96abddcd4469a79c77ee3a4480 ] + +The timeout of identify cmd, which is invoked as part of admin queue +creation, can result in freeing of async event data both in +nvme_rdma_timeout handler and error handling path of +nvme_rdma_configure_admin queue thus causing NULL pointer reference. +Call Trace: + ? nvme_rdma_setup_ctrl+0x223/0x800 [nvme_rdma] + nvme_rdma_create_ctrl+0x2ba/0x3f7 [nvme_rdma] + nvmf_dev_write+0xa54/0xcc6 [nvme_fabrics] + __vfs_write+0x1b/0x40 + vfs_write+0xb2/0x1b0 + ksys_write+0x61/0xd0 + __x64_sys_write+0x1a/0x20 + do_syscall_64+0x60/0x1e0 + entry_SYSCALL_64_after_hwframe+0x44/0xa9 + +Reviewed-by: Roland Dreier +Reviewed-by: Max Gurtovoy +Reviewed-by: Christoph Hellwig +Signed-off-by: Prabhath Sajeepa +Signed-off-by: Keith Busch +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/rdma.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c +index e4f167e35353f..9711bfbdf4316 100644 +--- a/drivers/nvme/host/rdma.c ++++ b/drivers/nvme/host/rdma.c +@@ -815,9 +815,11 @@ out_free_tagset: + if (new) + nvme_rdma_free_tagset(&ctrl->ctrl, ctrl->ctrl.admin_tagset); + out_free_async_qe: +- nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe, +- sizeof(struct nvme_command), DMA_TO_DEVICE); +- ctrl->async_event_sqe.data = NULL; ++ if (ctrl->async_event_sqe.data) { ++ nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe, ++ sizeof(struct nvme_command), DMA_TO_DEVICE); ++ ctrl->async_event_sqe.data = NULL; ++ } + out_free_queue: + nvme_rdma_free_queue(&ctrl->queues[0]); + return error; +-- +2.20.1 + diff --git a/queue-4.19/series b/queue-4.19/series index ae1a3cb1457..69141639c36 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -2,3 +2,10 @@ ipv4-fix-a-rcu-list-lock-in-fib_triestat_seq_show.patch net-ip_tunnel-fix-interface-lookup-with-no-key.patch sctp-fix-refcount-bug-in-sctp_wfree.patch sctp-fix-possibly-using-a-bad-saddr-with-a-given-dst.patch +nvme-rdma-avoid-double-freeing-of-async-event-data.patch +drm-amd-display-add-link_rate-quirk-for-apple-15-mbp.patch +drm-bochs-downgrade-pci_request_region-failure-from-.patch +initramfs-restore-default-compression-behavior.patch +drm-amdgpu-fix-typo-for-vcn1-idle-check.patch +tools-power-turbostat-fix-gcc-build-warnings.patch +tools-power-turbostat-fix-missing-sys_lpi-counter-on.patch diff --git a/queue-4.19/tools-power-turbostat-fix-gcc-build-warnings.patch b/queue-4.19/tools-power-turbostat-fix-gcc-build-warnings.patch new file mode 100644 index 00000000000..8d07956dbac --- /dev/null +++ b/queue-4.19/tools-power-turbostat-fix-gcc-build-warnings.patch @@ -0,0 +1,43 @@ +From 6ffd945ed0339d686f0257a6549b5f3ee7bbe166 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 19 Mar 2020 18:33:12 -0400 +Subject: tools/power turbostat: Fix gcc build warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Len Brown + +[ Upstream commit d8d005ba6afa502ca37ced5782f672c4d2fc1515 ] + +Warning: ‘__builtin_strncpy’ specified bound 20 equals destination size + [-Wstringop-truncation] + +reduce param to strncpy, to guarantee that a null byte is always copied +into destination buffer. + +Signed-off-by: Len Brown +Signed-off-by: Sasha Levin +--- + tools/power/x86/turbostat/turbostat.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c +index 02d123871ef95..fb665fdc722a4 100644 +--- a/tools/power/x86/turbostat/turbostat.c ++++ b/tools/power/x86/turbostat/turbostat.c +@@ -5144,9 +5144,9 @@ int add_counter(unsigned int msr_num, char *path, char *name, + } + + msrp->msr_num = msr_num; +- strncpy(msrp->name, name, NAME_BYTES); ++ strncpy(msrp->name, name, NAME_BYTES - 1); + if (path) +- strncpy(msrp->path, path, PATH_BYTES); ++ strncpy(msrp->path, path, PATH_BYTES - 1); + msrp->width = width; + msrp->type = type; + msrp->format = format; +-- +2.20.1 + diff --git a/queue-4.19/tools-power-turbostat-fix-missing-sys_lpi-counter-on.patch b/queue-4.19/tools-power-turbostat-fix-missing-sys_lpi-counter-on.patch new file mode 100644 index 00000000000..ce0d470a682 --- /dev/null +++ b/queue-4.19/tools-power-turbostat-fix-missing-sys_lpi-counter-on.patch @@ -0,0 +1,89 @@ +From 9e9e239f68e87ce6c33588f33835cdf2bb34f03a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 19 Mar 2020 18:26:05 -0400 +Subject: tools/power turbostat: Fix missing SYS_LPI counter on some + Chromebooks + +From: Len Brown + +[ Upstream commit 1f81c5efc020314b2db30d77efe228b7e117750d ] + +Some Chromebook BIOS' do not export an ACPI LPIT, which is how +Linux finds the residency counter for CPU and SYSTEM low power states, +that is exports in /sys/devices/system/cpu/cpuidle/*residency_us + +When these sysfs attributes are missing, check the debugfs attrubte +from the pmc_core driver, which accesses the same counter value. + +Signed-off-by: Len Brown +Signed-off-by: Sasha Levin +--- + tools/power/x86/turbostat/turbostat.c | 23 ++++++++++++++--------- + 1 file changed, 14 insertions(+), 9 deletions(-) + +diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c +index fb665fdc722a4..2233cf722c692 100644 +--- a/tools/power/x86/turbostat/turbostat.c ++++ b/tools/power/x86/turbostat/turbostat.c +@@ -299,6 +299,10 @@ int *irqs_per_cpu; /* indexed by cpu_num */ + + void setup_all_buffers(void); + ++char *sys_lpi_file; ++char *sys_lpi_file_sysfs = "/sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us"; ++char *sys_lpi_file_debugfs = "/sys/kernel/debug/pmc_core/slp_s0_residency_usec"; ++ + int cpu_is_not_present(int cpu) + { + return !CPU_ISSET_S(cpu, cpu_present_setsize, cpu_present_set); +@@ -2844,8 +2848,6 @@ int snapshot_gfx_mhz(void) + * + * record snapshot of + * /sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us +- * +- * return 1 if config change requires a restart, else return 0 + */ + int snapshot_cpu_lpi_us(void) + { +@@ -2865,17 +2867,14 @@ int snapshot_cpu_lpi_us(void) + /* + * snapshot_sys_lpi() + * +- * record snapshot of +- * /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us +- * +- * return 1 if config change requires a restart, else return 0 ++ * record snapshot of sys_lpi_file + */ + int snapshot_sys_lpi_us(void) + { + FILE *fp; + int retval; + +- fp = fopen_or_die("/sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us", "r"); ++ fp = fopen_or_die(sys_lpi_file, "r"); + + retval = fscanf(fp, "%lld", &cpuidle_cur_sys_lpi_us); + if (retval != 1) +@@ -4743,10 +4742,16 @@ void process_cpuid() + else + BIC_NOT_PRESENT(BIC_CPU_LPI); + +- if (!access("/sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us", R_OK)) ++ if (!access(sys_lpi_file_sysfs, R_OK)) { ++ sys_lpi_file = sys_lpi_file_sysfs; + BIC_PRESENT(BIC_SYS_LPI); +- else ++ } else if (!access(sys_lpi_file_debugfs, R_OK)) { ++ sys_lpi_file = sys_lpi_file_debugfs; ++ BIC_PRESENT(BIC_SYS_LPI); ++ } else { ++ sys_lpi_file_sysfs = NULL; + BIC_NOT_PRESENT(BIC_SYS_LPI); ++ } + + if (!quiet) + decode_misc_feature_control(); +-- +2.20.1 +