From: Greg Kroah-Hartman Date: Sat, 13 Aug 2022 12:57:31 +0000 (+0200) Subject: 5.19-stable patches X-Git-Tag: v5.15.61~179 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5de0ca5c2627a049df741b04009dcd1bc5b8e403;p=thirdparty%2Fkernel%2Fstable-queue.git 5.19-stable patches added patches: drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch drm-dp-mst-read-the-extended-dpcd-capabilities-during-system-resume.patch drm-fb-helper-fix-out-of-bounds-access.patch drm-gem-properly-annotate-ww-context-on-drm_gem_lock_reservations-error.patch drm-hyperv-drm-include-framebuffer-and-edid-headers.patch drm-ingenic-use-the-highest-possible-dma-burst-size.patch drm-nouveau-acpi-don-t-print-error-when-we-get-einprogress-from-pm_runtime.patch drm-nouveau-don-t-pm_runtime_put_sync-only-pm_runtime_put_autosuspend.patch drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch drm-nouveau-kms-fix-failure-path-for-creating-dp-connectors.patch drm-shmem-helper-add-missing-vunmap-on-error.patch drm-tegra-fix-vmapping-of-prime-buffers.patch drm-vc4-hdmi-disable-audio-if-dmas-property-is-present-but-empty.patch dt-bindings-riscv-fix-sifive-l2-cache-s-cache-sets.patch parisc-check-the-return-value-of-ioremap-in-lba_driver_probe.patch parisc-drop-pa_swapper_pg_lock-spinlock.patch parisc-fix-device-names-in-proc-iomem.patch parisc-io_pgetevents_time64-needs-compat-syscall-in-32-bit-compat-mode.patch risc-v-add-modules-to-virtual-kernel-memory-layout-dump.patch risc-v-cpu_ops_spinwait.c-should-include-head.h.patch risc-v-declare-cpu_ops_spinwait-in-asm-cpu_ops.h.patch risc-v-fix-counter-restart-during-overflow-for-rv32.patch risc-v-fix-sbi-pmu-calls-for-rv32.patch risc-v-fixup-get-incorrect-user-mode-pc-for-kernel-mode-regs.patch risc-v-fixup-schedule-out-issue-in-machine_crash_shutdown.patch risc-v-kexec-fixup-use-of-smp_processor_id-in-preemptible-context.patch risc-v-update-user-page-mapping-only-once-during-start.patch riscv-dts-starfive-correct-number-of-external-interrupts.patch riscv-lib-uaccess-fix-csr_status-sr_sum-bit.patch riscv-uprobe-fix-sr_spie-set-clear-handling.patch rtc-rx8025-fix-12-24-hour-mode-detection-on-rx-8035.patch wireguard-selftests-set-config_nonportable-on-riscv32.patch --- diff --git a/queue-5.19/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch b/queue-5.19/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch new file mode 100644 index 00000000000..a50904a9a00 --- /dev/null +++ b/queue-5.19/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch @@ -0,0 +1,49 @@ +From f5ba14043621f4afdf3ad5f92ee2d8dbebbe4340 Mon Sep 17 00:00:00 2001 +From: Leo Li +Date: Tue, 12 Jul 2022 12:30:29 -0400 +Subject: drm/amdgpu: Check BO's requested pinning domains against its preferred_domains +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Leo Li + +commit f5ba14043621f4afdf3ad5f92ee2d8dbebbe4340 upstream. + +When pinning a buffer, we should check to see if there are any +additional restrictions imposed by bo->preferred_domains. This will +prevent the BO from being moved to an invalid domain when pinning. + +For example, this can happen if the user requests to create a BO in GTT +domain for display scanout. amdgpu_dm will allow pinning to either VRAM +or GTT domains, since DCN can scanout from either or. However, in +amdgpu_bo_pin_restricted(), pinning to VRAM is preferred if there is +adequate carveout. This can lead to pinning to VRAM despite the user +requesting GTT placement for the BO. + +v2: Allow the kernel to override the domain, which can happen when + exporting a BO to a V4L camera (for example). + +Signed-off-by: Leo Li +Reviewed-by: Alex Deucher +Reviewed-by: Christian König +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +@@ -882,6 +882,10 @@ int amdgpu_bo_pin_restricted(struct amdg + if (WARN_ON_ONCE(min_offset > max_offset)) + return -EINVAL; + ++ /* Check domain to be pinned to against preferred domains */ ++ if (bo->preferred_domains & domain) ++ domain = bo->preferred_domains & domain; ++ + /* A shared bo cannot be migrated to VRAM */ + if (bo->tbo.base.import_attach) { + if (domain & AMDGPU_GEM_DOMAIN_GTT) diff --git a/queue-5.19/drm-dp-mst-read-the-extended-dpcd-capabilities-during-system-resume.patch b/queue-5.19/drm-dp-mst-read-the-extended-dpcd-capabilities-during-system-resume.patch new file mode 100644 index 00000000000..5683a09c7d9 --- /dev/null +++ b/queue-5.19/drm-dp-mst-read-the-extended-dpcd-capabilities-during-system-resume.patch @@ -0,0 +1,52 @@ +From 7a710a8bc909313951eb9252d8419924c771d7c2 Mon Sep 17 00:00:00 2001 +From: Imre Deak +Date: Tue, 14 Jun 2022 12:45:37 +0300 +Subject: drm/dp/mst: Read the extended DPCD capabilities during system resume + +From: Imre Deak + +commit 7a710a8bc909313951eb9252d8419924c771d7c2 upstream. + +The WD22TB4 Thunderbolt dock at least will revert its DP_MAX_LINK_RATE +from HBR3 to HBR2 after system suspend/resume if the DP_DP13_DPCD_REV +registers are not read subsequently also as required. + +Fix this by reading DP_DP13_DPCD_REV registers as well, matching what is +done during connector detection. While at it also fix up the same call +in drm_dp_mst_dump_topology(). + +Cc: Lyude Paul +Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5292 +Signed-off-by: Imre Deak +Reviewed-by: Jani Nikula +Cc: # v5.14+ +Reviewed-by: Lyude Paul +Link: https://patchwork.freedesktop.org/patch/msgid/20220614094537.885472-1-imre.deak@intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/display/drm_dp_mst_topology.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c ++++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c +@@ -3860,9 +3860,7 @@ int drm_dp_mst_topology_mgr_resume(struc + if (!mgr->mst_primary) + goto out_fail; + +- ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd, +- DP_RECEIVER_CAP_SIZE); +- if (ret != DP_RECEIVER_CAP_SIZE) { ++ if (drm_dp_read_dpcd_caps(mgr->aux, mgr->dpcd) < 0) { + drm_dbg_kms(mgr->dev, "dpcd read failed - undocked during suspend?\n"); + goto out_fail; + } +@@ -4911,8 +4909,7 @@ void drm_dp_mst_dump_topology(struct seq + u8 buf[DP_PAYLOAD_TABLE_SIZE]; + int ret; + +- ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, buf, DP_RECEIVER_CAP_SIZE); +- if (ret) { ++ if (drm_dp_read_dpcd_caps(mgr->aux, buf) < 0) { + seq_printf(m, "dpcd read failed\n"); + goto out; + } diff --git a/queue-5.19/drm-fb-helper-fix-out-of-bounds-access.patch b/queue-5.19/drm-fb-helper-fix-out-of-bounds-access.patch new file mode 100644 index 00000000000..c36b664a062 --- /dev/null +++ b/queue-5.19/drm-fb-helper-fix-out-of-bounds-access.patch @@ -0,0 +1,95 @@ +From ae25885bdf59fde40726863c57fd20e4a0642183 Mon Sep 17 00:00:00 2001 +From: Thomas Zimmermann +Date: Tue, 21 Jun 2022 12:46:17 +0200 +Subject: drm/fb-helper: Fix out-of-bounds access +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Thomas Zimmermann + +commit ae25885bdf59fde40726863c57fd20e4a0642183 upstream. + +Clip memory range to screen-buffer size to avoid out-of-bounds access +in fbdev deferred I/O's damage handling. + +Fbdev's deferred I/O can only track pages. From the range of pages, the +damage handler computes the clipping rectangle for the display update. +If the fbdev screen buffer ends near the beginning of a page, that page +could contain more scanlines. The damage handler would then track these +non-existing scanlines as dirty and provoke an out-of-bounds access +during the screen update. Hence, clip the maximum memory range to the +size of the screen buffer. + +While at it, rename the variables min/max to min_off/max_off in +drm_fb_helper_deferred_io(). This avoids confusion with the macros of +the same name. + +Reported-by: Nuno Gonçalves +Signed-off-by: Thomas Zimmermann +Reviewed-by: Javier Martinez Canillas +Tested-by: Nuno Gonçalves +Fixes: 67b723f5b742 ("drm/fb-helper: Calculate damaged area in separate helper") +Cc: Thomas Zimmermann +Cc: Javier Martinez Canillas +Cc: Maarten Lankhorst +Cc: Maxime Ripard +Cc: # v5.18+ +Link: https://patchwork.freedesktop.org/patch/msgid/20220621104617.8817-1-tzimmermann@suse.de +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/drm_fb_helper.c | 27 +++++++++++++++++++-------- + 1 file changed, 19 insertions(+), 8 deletions(-) + +--- a/drivers/gpu/drm/drm_fb_helper.c ++++ b/drivers/gpu/drm/drm_fb_helper.c +@@ -680,7 +680,11 @@ static void drm_fb_helper_damage(struct + schedule_work(&helper->damage_work); + } + +-/* Convert memory region into area of scanlines and pixels per scanline */ ++/* ++ * Convert memory region into area of scanlines and pixels per ++ * scanline. The parameters off and len must not reach beyond ++ * the end of the framebuffer. ++ */ + static void drm_fb_helper_memory_range_to_clip(struct fb_info *info, off_t off, size_t len, + struct drm_rect *clip) + { +@@ -715,22 +719,29 @@ static void drm_fb_helper_memory_range_t + */ + void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist) + { +- unsigned long start, end, min, max; ++ unsigned long start, end, min_off, max_off; + struct fb_deferred_io_pageref *pageref; + struct drm_rect damage_area; + +- min = ULONG_MAX; +- max = 0; ++ min_off = ULONG_MAX; ++ max_off = 0; + list_for_each_entry(pageref, pagereflist, list) { + start = pageref->offset; + end = start + PAGE_SIZE; +- min = min(min, start); +- max = max(max, end); ++ min_off = min(min_off, start); ++ max_off = max(max_off, end); + } +- if (min >= max) ++ if (min_off >= max_off) + return; + +- drm_fb_helper_memory_range_to_clip(info, min, max - min, &damage_area); ++ /* ++ * As we can only track pages, we might reach beyond the end ++ * of the screen and account for non-existing scanlines. Hence, ++ * keep the covered memory area within the screen buffer. ++ */ ++ max_off = min(max_off, info->screen_size); ++ ++ drm_fb_helper_memory_range_to_clip(info, min_off, max_off - min_off, &damage_area); + drm_fb_helper_damage(info, damage_area.x1, damage_area.y1, + drm_rect_width(&damage_area), + drm_rect_height(&damage_area)); diff --git a/queue-5.19/drm-gem-properly-annotate-ww-context-on-drm_gem_lock_reservations-error.patch b/queue-5.19/drm-gem-properly-annotate-ww-context-on-drm_gem_lock_reservations-error.patch new file mode 100644 index 00000000000..3c5a59e1e4f --- /dev/null +++ b/queue-5.19/drm-gem-properly-annotate-ww-context-on-drm_gem_lock_reservations-error.patch @@ -0,0 +1,50 @@ +From 2939deac1fa220bc82b89235f146df1d9b52e876 Mon Sep 17 00:00:00 2001 +From: Dmitry Osipenko +Date: Thu, 30 Jun 2022 23:04:04 +0300 +Subject: drm/gem: Properly annotate WW context on drm_gem_lock_reservations() error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Dmitry Osipenko + +commit 2939deac1fa220bc82b89235f146df1d9b52e876 upstream. + +Use ww_acquire_fini() in the error code paths. Otherwise lockdep +thinks that lock is held when lock's memory is freed after the +drm_gem_lock_reservations() error. The ww_acquire_context needs to be +annotated as "released", which fixes the noisy "WARNING: held lock freed!" +splat of VirtIO-GPU driver with CONFIG_DEBUG_MUTEXES=y and enabled lockdep. + +Cc: stable@vger.kernel.org +Fixes: 7edc3e3b975b5 ("drm: Add helpers for locking an array of BO reservations.") +Reviewed-by: Thomas Hellström +Reviewed-by: Christian König +Signed-off-by: Dmitry Osipenko +Signed-off-by: Daniel Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20220630200405.1883897-2-dmitry.osipenko@collabora.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/drm_gem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/drm_gem.c ++++ b/drivers/gpu/drm/drm_gem.c +@@ -1226,7 +1226,7 @@ retry: + ret = dma_resv_lock_slow_interruptible(obj->resv, + acquire_ctx); + if (ret) { +- ww_acquire_done(acquire_ctx); ++ ww_acquire_fini(acquire_ctx); + return ret; + } + } +@@ -1251,7 +1251,7 @@ retry: + goto retry; + } + +- ww_acquire_done(acquire_ctx); ++ ww_acquire_fini(acquire_ctx); + return ret; + } + } diff --git a/queue-5.19/drm-hyperv-drm-include-framebuffer-and-edid-headers.patch b/queue-5.19/drm-hyperv-drm-include-framebuffer-and-edid-headers.patch new file mode 100644 index 00000000000..cc167529d7d --- /dev/null +++ b/queue-5.19/drm-hyperv-drm-include-framebuffer-and-edid-headers.patch @@ -0,0 +1,62 @@ +From 009a3a52791f31c57d755a73f6bc66fbdd8bd76c Mon Sep 17 00:00:00 2001 +From: Thomas Zimmermann +Date: Wed, 22 Jun 2022 10:34:13 +0200 +Subject: drm/hyperv-drm: Include framebuffer and EDID headers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Thomas Zimmermann + +commit 009a3a52791f31c57d755a73f6bc66fbdd8bd76c upstream. + +Fix a number of compile errors by including the correct header +files. Examples are shown below. + + ../drivers/gpu/drm/hyperv/hyperv_drm_modeset.c: In function 'hyperv_blit_to_vram_rect': + ../drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:25:48: error: invalid use of undefined type 'struct drm_framebuffer' + 25 | struct hyperv_drm_device *hv = to_hv(fb->dev); + | ^~ + + ../drivers/gpu/drm/hyperv/hyperv_drm_modeset.c: In function 'hyperv_connector_get_modes': + ../drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:59:17: error: implicit declaration of function 'drm_add_modes_noedid' [-Werror=implicit-function-declaration] + 59 | count = drm_add_modes_noedid(connector, + | ^~~~~~~~~~~~~~~~~~~~ + + ../drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:62:9: error: implicit declaration of function 'drm_set_preferred_mode'; did you mean 'drm_mm_reserve_node'? [-Werror=implicit-function-declaration] + 62 | drm_set_preferred_mode(connector, hv->preferred_width, + | ^~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Thomas Zimmermann +Fixes: 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video device") +Fixes: 720cf96d8fec ("drm: Drop drm_framebuffer.h from drm_crtc.h") +Fixes: 255490f9150d ("drm: Drop drm_edid.h from drm_crtc.h") +Cc: Deepak Rawat +Cc: Thomas Zimmermann +Cc: Maarten Lankhorst +Cc: Maxime Ripard +Cc: linux-hyperv@vger.kernel.org +Cc: dri-devel@lists.freedesktop.org +Cc: # v5.14+ +Acked-by: Maxime Ripard +Reviewed-by: Ville Syrjälä +Link: https://patchwork.freedesktop.org/patch/msgid/20220622083413.12573-1-tzimmermann@suse.de +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c ++++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +@@ -7,9 +7,11 @@ + + #include + #include ++#include + #include + #include + #include ++#include + #include + #include + #include diff --git a/queue-5.19/drm-ingenic-use-the-highest-possible-dma-burst-size.patch b/queue-5.19/drm-ingenic-use-the-highest-possible-dma-burst-size.patch new file mode 100644 index 00000000000..627237a69f2 --- /dev/null +++ b/queue-5.19/drm-ingenic-use-the-highest-possible-dma-burst-size.patch @@ -0,0 +1,103 @@ +From f0dce5c4fdaf9e98dd2755ffb1363822854b6287 Mon Sep 17 00:00:00 2001 +From: Paul Cercueil +Date: Sun, 3 Jul 2022 00:07:27 +0100 +Subject: drm/ingenic: Use the highest possible DMA burst size + +From: Paul Cercueil + +commit f0dce5c4fdaf9e98dd2755ffb1363822854b6287 upstream. + +Until now, when running at the maximum resolution of 1280x720 at 32bpp +on the JZ4770 SoC the output was garbled, the X/Y position of the +top-left corner of the framebuffer warping to a random position with +the whole image being offset accordingly, every time a new frame was +being submitted. + +This problem can be eliminated by using a bigger burst size for the DMA. + +Set in each soc_info structure the maximum burst size supported by the +corresponding SoC, and use it in the driver. + +Set the new value using regmap_update_bits() instead of +regmap_set_bits(), since we do want to override the old value of the +burst size. (Note that regmap_set_bits() wasn't really valid before for +the same reason, but it never seemed to be a problem). + +Cc: +Fixes: 90b86fcc47b4 ("DRM: Add KMS driver for the Ingenic JZ47xx SoCs") +Signed-off-by: Paul Cercueil +Link: https://patchwork.freedesktop.org/patch/msgid/20220702230727.66704-1-paul@crapouillou.net +Acked-by: Sam Ravnborg +Tested-by: Christophe Branchereau +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 10 ++++++++-- + drivers/gpu/drm/ingenic/ingenic-drm.h | 3 +++ + 2 files changed, 11 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c ++++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +@@ -69,6 +69,7 @@ struct jz_soc_info { + bool map_noncoherent; + bool use_extended_hwdesc; + bool plane_f0_not_working; ++ u32 max_burst; + unsigned int max_width, max_height; + const u32 *formats_f0, *formats_f1; + unsigned int num_formats_f0, num_formats_f1; +@@ -318,8 +319,9 @@ static void ingenic_drm_crtc_update_timi + regmap_write(priv->map, JZ_REG_LCD_REV, mode->htotal << 16); + } + +- regmap_set_bits(priv->map, JZ_REG_LCD_CTRL, +- JZ_LCD_CTRL_OFUP | JZ_LCD_CTRL_BURST_16); ++ regmap_update_bits(priv->map, JZ_REG_LCD_CTRL, ++ JZ_LCD_CTRL_OFUP | JZ_LCD_CTRL_BURST_MASK, ++ JZ_LCD_CTRL_OFUP | priv->soc_info->max_burst); + + /* + * IPU restart - specify how much time the LCDC will wait before +@@ -1518,6 +1520,7 @@ static const struct jz_soc_info jz4740_s + .map_noncoherent = false, + .max_width = 800, + .max_height = 600, ++ .max_burst = JZ_LCD_CTRL_BURST_16, + .formats_f1 = jz4740_formats, + .num_formats_f1 = ARRAY_SIZE(jz4740_formats), + /* JZ4740 has only one plane */ +@@ -1529,6 +1532,7 @@ static const struct jz_soc_info jz4725b_ + .map_noncoherent = false, + .max_width = 800, + .max_height = 600, ++ .max_burst = JZ_LCD_CTRL_BURST_16, + .formats_f1 = jz4725b_formats_f1, + .num_formats_f1 = ARRAY_SIZE(jz4725b_formats_f1), + .formats_f0 = jz4725b_formats_f0, +@@ -1541,6 +1545,7 @@ static const struct jz_soc_info jz4770_s + .map_noncoherent = true, + .max_width = 1280, + .max_height = 720, ++ .max_burst = JZ_LCD_CTRL_BURST_64, + .formats_f1 = jz4770_formats_f1, + .num_formats_f1 = ARRAY_SIZE(jz4770_formats_f1), + .formats_f0 = jz4770_formats_f0, +@@ -1555,6 +1560,7 @@ static const struct jz_soc_info jz4780_s + .plane_f0_not_working = true, /* REVISIT */ + .max_width = 4096, + .max_height = 2048, ++ .max_burst = JZ_LCD_CTRL_BURST_64, + .formats_f1 = jz4770_formats_f1, + .num_formats_f1 = ARRAY_SIZE(jz4770_formats_f1), + .formats_f0 = jz4770_formats_f0, +--- a/drivers/gpu/drm/ingenic/ingenic-drm.h ++++ b/drivers/gpu/drm/ingenic/ingenic-drm.h +@@ -106,6 +106,9 @@ + #define JZ_LCD_CTRL_BURST_4 (0x0 << 28) + #define JZ_LCD_CTRL_BURST_8 (0x1 << 28) + #define JZ_LCD_CTRL_BURST_16 (0x2 << 28) ++#define JZ_LCD_CTRL_BURST_32 (0x3 << 28) ++#define JZ_LCD_CTRL_BURST_64 (0x4 << 28) ++#define JZ_LCD_CTRL_BURST_MASK (0x7 << 28) + #define JZ_LCD_CTRL_RGB555 BIT(27) + #define JZ_LCD_CTRL_OFUP BIT(26) + #define JZ_LCD_CTRL_FRC_GRAYSCALE_16 (0x0 << 24) diff --git a/queue-5.19/drm-nouveau-acpi-don-t-print-error-when-we-get-einprogress-from-pm_runtime.patch b/queue-5.19/drm-nouveau-acpi-don-t-print-error-when-we-get-einprogress-from-pm_runtime.patch new file mode 100644 index 00000000000..9cb6ccd872d --- /dev/null +++ b/queue-5.19/drm-nouveau-acpi-don-t-print-error-when-we-get-einprogress-from-pm_runtime.patch @@ -0,0 +1,32 @@ +From 53c26181950ddc3c8ace3c0939c89e9c4d8deeb9 Mon Sep 17 00:00:00 2001 +From: Lyude Paul +Date: Thu, 14 Jul 2022 13:42:33 -0400 +Subject: drm/nouveau/acpi: Don't print error when we get -EINPROGRESS from pm_runtime + +From: Lyude Paul + +commit 53c26181950ddc3c8ace3c0939c89e9c4d8deeb9 upstream. + +Since this isn't actually a failure. + +Signed-off-by: Lyude Paul +Reviewed-by: David Airlie +Fixes: 79e765ad665d ("drm/nouveau/drm/nouveau: Prevent handling ACPI HPD events too early") +Cc: # v4.19+ +Link: https://patchwork.freedesktop.org/patch/msgid/20220714174234.949259-2-lyude@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/nouveau/nouveau_display.c ++++ b/drivers/gpu/drm/nouveau/nouveau_display.c +@@ -537,7 +537,7 @@ nouveau_display_acpi_ntfy(struct notifie + * it's own hotplug events. + */ + pm_runtime_put_autosuspend(drm->dev->dev); +- } else if (ret == 0) { ++ } else if (ret == 0 || ret == -EINPROGRESS) { + /* We've started resuming the GPU already, so + * it will handle scheduling a full reprobe + * itself diff --git a/queue-5.19/drm-nouveau-don-t-pm_runtime_put_sync-only-pm_runtime_put_autosuspend.patch b/queue-5.19/drm-nouveau-don-t-pm_runtime_put_sync-only-pm_runtime_put_autosuspend.patch new file mode 100644 index 00000000000..4d11d5f1698 --- /dev/null +++ b/queue-5.19/drm-nouveau-don-t-pm_runtime_put_sync-only-pm_runtime_put_autosuspend.patch @@ -0,0 +1,54 @@ +From c96cfaf8fc02d4bb70727dfa7ce7841a3cff9be2 Mon Sep 17 00:00:00 2001 +From: Lyude Paul +Date: Thu, 14 Jul 2022 13:42:34 -0400 +Subject: drm/nouveau: Don't pm_runtime_put_sync(), only pm_runtime_put_autosuspend() + +From: Lyude Paul + +commit c96cfaf8fc02d4bb70727dfa7ce7841a3cff9be2 upstream. + +While trying to fix another issue, it occurred to me that I don't actually +think there is any situation where we want pm_runtime_put() in nouveau to +be synchronous. In fact, this kind of just seems like it would cause +issues where we may unexpectedly block a thread we don't expect to be +blocked. + +So, let's only use pm_runtime_put_autosuspend(). + +Changes since v1: +* Use pm_runtime_put_autosuspend(), not pm_runtime_put() + +Signed-off-by: Lyude Paul +Reviewed-by: David Airlie +Fixes: 3a6536c51d5d ("drm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBE") +Cc: Hans de Goede +Cc: # v4.10+ +Link: https://patchwork.freedesktop.org/patch/msgid/20220714174234.949259-3-lyude@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- + drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/nouveau/nouveau_display.c ++++ b/drivers/gpu/drm/nouveau/nouveau_display.c +@@ -515,7 +515,7 @@ nouveau_display_hpd_work(struct work_str + + pm_runtime_mark_last_busy(drm->dev->dev); + noop: +- pm_runtime_put_sync(drm->dev->dev); ++ pm_runtime_put_autosuspend(dev->dev); + } + + #ifdef CONFIG_ACPI +--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c ++++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c +@@ -466,7 +466,7 @@ nouveau_fbcon_set_suspend_work(struct wo + if (state == FBINFO_STATE_RUNNING) { + nouveau_fbcon_hotplug_resume(drm->fbcon); + pm_runtime_mark_last_busy(drm->dev->dev); +- pm_runtime_put_sync(drm->dev->dev); ++ pm_runtime_put_autosuspend(drm->dev->dev); + } + } + diff --git a/queue-5.19/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch b/queue-5.19/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch new file mode 100644 index 00000000000..a3edec84b86 --- /dev/null +++ b/queue-5.19/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch @@ -0,0 +1,35 @@ +From c441d28945fb113220d48d6c86ebc0b090a2b677 Mon Sep 17 00:00:00 2001 +From: Timur Tabi +Date: Wed, 11 May 2022 11:37:16 -0500 +Subject: drm/nouveau: fix another off-by-one in nvbios_addr + +From: Timur Tabi + +commit c441d28945fb113220d48d6c86ebc0b090a2b677 upstream. + +This check determines whether a given address is part of +image 0 or image 1. Image 1 starts at offset image0_size, +so that address should be included. + +Fixes: 4d4e9907ff572 ("drm/nouveau/bios: guard against out-of-bounds accesses to image") +Cc: # v4.8+ +Signed-off-by: Timur Tabi +Reviewed-by: Karol Herbst +Signed-off-by: Lyude Paul +Link: https://patchwork.freedesktop.org/patch/msgid/20220511163716.3520591-1-ttabi@nvidia.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c +@@ -33,7 +33,7 @@ nvbios_addr(struct nvkm_bios *bios, u32 + { + u32 p = *addr; + +- if (*addr > bios->image0_size && bios->imaged_addr) { ++ if (*addr >= bios->image0_size && bios->imaged_addr) { + *addr -= bios->image0_size; + *addr += bios->imaged_addr; + } diff --git a/queue-5.19/drm-nouveau-kms-fix-failure-path-for-creating-dp-connectors.patch b/queue-5.19/drm-nouveau-kms-fix-failure-path-for-creating-dp-connectors.patch new file mode 100644 index 00000000000..8e753c78c82 --- /dev/null +++ b/queue-5.19/drm-nouveau-kms-fix-failure-path-for-creating-dp-connectors.patch @@ -0,0 +1,46 @@ +From ca0367ca5d9216644b41f86348d6661f8d9e32d8 Mon Sep 17 00:00:00 2001 +From: Lyude Paul +Date: Thu, 26 May 2022 16:43:13 -0400 +Subject: drm/nouveau/kms: Fix failure path for creating DP connectors + +From: Lyude Paul + +commit ca0367ca5d9216644b41f86348d6661f8d9e32d8 upstream. + +It looks like that when we moved nouveau over to using drm_dp_aux_init() +and registering it's aux bus during late connector registration, we totally +forgot to fix the failure codepath in nouveau_connector_create() - as it +still seems to assume that drm_dp_aux_init() can fail (it can't). + +So, let's fix that and also add a missing check to ensure that we've +properly allocated nv_connector->aux.name while we're at it. + +Signed-off-by: Lyude Paul +Reviewed-by: David Airlie +Fixes: fd43ad9d47e7 ("drm/nouveau/kms/nv50-: Move AUX adapter reg to connector late register/early unregister") +Cc: # v5.14+ +Link: https://patchwork.freedesktop.org/patch/msgid/20220526204313.656473-1-lyude@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/nouveau/nouveau_connector.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +--- a/drivers/gpu/drm/nouveau/nouveau_connector.c ++++ b/drivers/gpu/drm/nouveau/nouveau_connector.c +@@ -1361,13 +1361,11 @@ nouveau_connector_create(struct drm_devi + snprintf(aux_name, sizeof(aux_name), "sor-%04x-%04x", + dcbe->hasht, dcbe->hashm); + nv_connector->aux.name = kstrdup(aux_name, GFP_KERNEL); +- drm_dp_aux_init(&nv_connector->aux); +- if (ret) { +- NV_ERROR(drm, "Failed to init AUX adapter for sor-%04x-%04x: %d\n", +- dcbe->hasht, dcbe->hashm, ret); ++ if (!nv_connector->aux.name) { + kfree(nv_connector); +- return ERR_PTR(ret); ++ return ERR_PTR(-ENOMEM); + } ++ drm_dp_aux_init(&nv_connector->aux); + fallthrough; + default: + funcs = &nouveau_connector_funcs; diff --git a/queue-5.19/drm-shmem-helper-add-missing-vunmap-on-error.patch b/queue-5.19/drm-shmem-helper-add-missing-vunmap-on-error.patch new file mode 100644 index 00000000000..6688462b528 --- /dev/null +++ b/queue-5.19/drm-shmem-helper-add-missing-vunmap-on-error.patch @@ -0,0 +1,33 @@ +From df4aaf015775221dde8a51ee09edb919981f091e Mon Sep 17 00:00:00 2001 +From: Dmitry Osipenko +Date: Thu, 30 Jun 2022 23:00:57 +0300 +Subject: drm/shmem-helper: Add missing vunmap on error + +From: Dmitry Osipenko + +commit df4aaf015775221dde8a51ee09edb919981f091e upstream. + +The vmapping of dma-buf may succeed, but DRM SHMEM rejects the IOMEM +mapping, and thus, drm_gem_shmem_vmap_locked() should unvmap the IOMEM +before erroring out. + +Cc: stable@vger.kernel.org +Fixes: 49a3f51dfeee ("drm/gem: Use struct dma_buf_map in GEM vmap ops and convert GEM backends") +Signed-off-by: Dmitry Osipenko +Signed-off-by: Daniel Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20220630200058.1883506-2-dmitry.osipenko@collabora.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/drm_gem_shmem_helper.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpu/drm/drm_gem_shmem_helper.c ++++ b/drivers/gpu/drm/drm_gem_shmem_helper.c +@@ -302,6 +302,7 @@ static int drm_gem_shmem_vmap_locked(str + ret = dma_buf_vmap(obj->import_attach->dmabuf, map); + if (!ret) { + if (WARN_ON(map->is_iomem)) { ++ dma_buf_vunmap(obj->import_attach->dmabuf, map); + ret = -EIO; + goto err_put_pages; + } diff --git a/queue-5.19/drm-tegra-fix-vmapping-of-prime-buffers.patch b/queue-5.19/drm-tegra-fix-vmapping-of-prime-buffers.patch new file mode 100644 index 00000000000..8e6e9f2f61b --- /dev/null +++ b/queue-5.19/drm-tegra-fix-vmapping-of-prime-buffers.patch @@ -0,0 +1,51 @@ +From c7860cbee9989882d2908682526a5ef617523cfe Mon Sep 17 00:00:00 2001 +From: Dmitry Osipenko +Date: Wed, 29 Jun 2022 01:42:39 +0300 +Subject: drm/tegra: Fix vmapping of prime buffers + +From: Dmitry Osipenko + +commit c7860cbee9989882d2908682526a5ef617523cfe upstream. + +The code assumes that Tegra GEM is permanently vmapped, which is not +true for the scattered buffers. After converting Tegra video decoder +driver to V4L API, we're now getting a BUG_ON from dma-buf core on playing +video using libvdpau-tegra on T30+ because tegra_gem_prime_vmap() sets +vaddr to NULL. Older pre-V4L video decoder driver wasn't vmapping dma-bufs. +Fix it by actually vmapping the exported GEMs. + +Cc: stable@vger.kernel.org +Signed-off-by: Dmitry Osipenko +Signed-off-by: Thierry Reding +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/tegra/gem.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/tegra/gem.c ++++ b/drivers/gpu/drm/tegra/gem.c +@@ -704,14 +704,23 @@ static int tegra_gem_prime_vmap(struct d + { + struct drm_gem_object *gem = buf->priv; + struct tegra_bo *bo = to_tegra_bo(gem); ++ void *vaddr; + +- iosys_map_set_vaddr(map, bo->vaddr); ++ vaddr = tegra_bo_mmap(&bo->base); ++ if (IS_ERR(vaddr)) ++ return PTR_ERR(vaddr); ++ ++ iosys_map_set_vaddr(map, vaddr); + + return 0; + } + + static void tegra_gem_prime_vunmap(struct dma_buf *buf, struct iosys_map *map) + { ++ struct drm_gem_object *gem = buf->priv; ++ struct tegra_bo *bo = to_tegra_bo(gem); ++ ++ tegra_bo_munmap(&bo->base, map->vaddr); + } + + static const struct dma_buf_ops tegra_gem_prime_dmabuf_ops = { diff --git a/queue-5.19/drm-vc4-hdmi-disable-audio-if-dmas-property-is-present-but-empty.patch b/queue-5.19/drm-vc4-hdmi-disable-audio-if-dmas-property-is-present-but-empty.patch new file mode 100644 index 00000000000..acb5d3fe539 --- /dev/null +++ b/queue-5.19/drm-vc4-hdmi-disable-audio-if-dmas-property-is-present-but-empty.patch @@ -0,0 +1,46 @@ +From db2b927f8668adf3ac765e0921cd2720f5c04172 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 13 Jun 2022 16:47:44 +0200 +Subject: drm/vc4: hdmi: Disable audio if dmas property is present but empty + +From: Phil Elwell + +commit db2b927f8668adf3ac765e0921cd2720f5c04172 upstream. + +The dmas property is used to hold the dmaengine channel used for audio +output. + +Older device trees were missing that property, so if it's not there we +disable the audio output entirely. + +However, some overlays have set an empty value to that property, mostly +to workaround the fact that overlays cannot remove a property. Let's add +a test for that case and if it's empty, let's disable it as well. + +Cc: +Signed-off-by: Phil Elwell +Link: https://lore.kernel.org/r/20220613144800.326124-18-maxime@cerno.tech +Signed-off-by: Maxime Ripard +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -2035,12 +2035,12 @@ static int vc4_hdmi_audio_init(struct vc + struct device *dev = &vc4_hdmi->pdev->dev; + struct platform_device *codec_pdev; + const __be32 *addr; +- int index; ++ int index, len; + int ret; + +- if (!of_find_property(dev->of_node, "dmas", NULL)) { ++ if (!of_find_property(dev->of_node, "dmas", &len) || !len) { + dev_warn(dev, +- "'dmas' DT property is missing, no HDMI audio\n"); ++ "'dmas' DT property is missing or empty, no HDMI audio\n"); + return 0; + } + diff --git a/queue-5.19/dt-bindings-riscv-fix-sifive-l2-cache-s-cache-sets.patch b/queue-5.19/dt-bindings-riscv-fix-sifive-l2-cache-s-cache-sets.patch new file mode 100644 index 00000000000..bf1c3a9c886 --- /dev/null +++ b/queue-5.19/dt-bindings-riscv-fix-sifive-l2-cache-s-cache-sets.patch @@ -0,0 +1,64 @@ +From b60cf8e59e61133b6c9514ff8d8c8d7049d040ef Mon Sep 17 00:00:00 2001 +From: Conor Dooley +Date: Wed, 3 Aug 2022 19:54:00 +0100 +Subject: dt-bindings: riscv: fix SiFive l2-cache's cache-sets + +From: Conor Dooley + +commit b60cf8e59e61133b6c9514ff8d8c8d7049d040ef upstream. + +Fix device tree schema validation error messages for the SiFive +Unmatched: ' cache-sets:0:0: 1024 was expected'. + +The existing bindings allow for just 1024 cache-sets but the fu740 on +Unmatched the has 2048 cache-sets. The ISA itself permits any arbitrary +power of two, however this is not supported by dt-schema. The RTL for +the IP, to which the number of cache-sets is a tunable parameter, has +been released publicly so speculatively adding a small number of +"reasonable" values seems unwise also. + +Instead, as the binding only supports two distinct controllers: add 2048 +and explicitly lock it to the fu740's l2 cache while limiting 1024 to +the l2 cache on the fu540. + +Fixes: af951c3a113b ("dt-bindings: riscv: Update l2 cache DT documentation to add support for SiFive FU740") +Reported-by: Atul Khare +Signed-off-by: Conor Dooley +Reviewed-by: Krzysztof Kozlowski +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220803185359.942928-1-mail@conchuod.ie +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml ++++ b/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml +@@ -46,7 +46,7 @@ properties: + const: 2 + + cache-sets: +- const: 1024 ++ enum: [1024, 2048] + + cache-size: + const: 2097152 +@@ -84,6 +84,8 @@ then: + description: | + Must contain entries for DirError, DataError and DataFail signals. + maxItems: 3 ++ cache-sets: ++ const: 1024 + + else: + properties: +@@ -91,6 +93,8 @@ else: + description: | + Must contain entries for DirError, DataError, DataFail, DirFail signals. + minItems: 4 ++ cache-sets: ++ const: 2048 + + additionalProperties: false + diff --git a/queue-5.19/parisc-check-the-return-value-of-ioremap-in-lba_driver_probe.patch b/queue-5.19/parisc-check-the-return-value-of-ioremap-in-lba_driver_probe.patch new file mode 100644 index 00000000000..38a8105c436 --- /dev/null +++ b/queue-5.19/parisc-check-the-return-value-of-ioremap-in-lba_driver_probe.patch @@ -0,0 +1,39 @@ +From cf59f34d7f978d14d6520fd80a78a5ad5cb8abf8 Mon Sep 17 00:00:00 2001 +From: William Dean +Date: Fri, 22 Jul 2022 10:57:09 +0800 +Subject: parisc: Check the return value of ioremap() in lba_driver_probe() + +From: William Dean + +commit cf59f34d7f978d14d6520fd80a78a5ad5cb8abf8 upstream. + +The function ioremap() in lba_driver_probe() can fail, so +its return value should be checked. + +Fixes: 4bdc0d676a643 ("remove ioremap_nocache and devm_ioremap_nocache") +Reported-by: Hacash Robot +Signed-off-by: William Dean +Signed-off-by: Helge Deller +Cc: # v5.6+ +Signed-off-by: Greg Kroah-Hartman +--- + drivers/parisc/lba_pci.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/parisc/lba_pci.c ++++ b/drivers/parisc/lba_pci.c +@@ -1476,9 +1476,13 @@ lba_driver_probe(struct parisc_device *d + u32 func_class; + void *tmp_obj; + char *version; +- void __iomem *addr = ioremap(dev->hpa.start, 4096); ++ void __iomem *addr; + int max; + ++ addr = ioremap(dev->hpa.start, 4096); ++ if (addr == NULL) ++ return -ENOMEM; ++ + /* Read HW Rev First */ + func_class = READ_REG32(addr + LBA_FCLASS); + diff --git a/queue-5.19/parisc-drop-pa_swapper_pg_lock-spinlock.patch b/queue-5.19/parisc-drop-pa_swapper_pg_lock-spinlock.patch new file mode 100644 index 00000000000..48415d69b8c --- /dev/null +++ b/queue-5.19/parisc-drop-pa_swapper_pg_lock-spinlock.patch @@ -0,0 +1,34 @@ +From 3fbc9a7de0564c55d8a9584c9cd2c9dfe6bd6d43 Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Tue, 19 Jul 2022 06:19:41 +0200 +Subject: parisc: Drop pa_swapper_pg_lock spinlock + +From: Helge Deller + +commit 3fbc9a7de0564c55d8a9584c9cd2c9dfe6bd6d43 upstream. + +This spinlock was dropped with commit b7795074a046 ("parisc: Optimize +per-pagetable spinlocks") in kernel v5.12. + +Remove it to silence a sparse warning. + +Signed-off-by: Helge Deller +Reported-by: kernel test robot +Cc: # v5.12+ +Signed-off-by: Greg Kroah-Hartman +--- + arch/parisc/kernel/cache.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/arch/parisc/kernel/cache.c ++++ b/arch/parisc/kernel/cache.c +@@ -50,9 +50,6 @@ void flush_instruction_cache_local(void) + */ + DEFINE_SPINLOCK(pa_tlb_flush_lock); + +-/* Swapper page setup lock. */ +-DEFINE_SPINLOCK(pa_swapper_pg_lock); +- + #if defined(CONFIG_64BIT) && defined(CONFIG_SMP) + int pa_serialize_tlb_flushes __ro_after_init; + #endif diff --git a/queue-5.19/parisc-fix-device-names-in-proc-iomem.patch b/queue-5.19/parisc-fix-device-names-in-proc-iomem.patch new file mode 100644 index 00000000000..66197efc351 --- /dev/null +++ b/queue-5.19/parisc-fix-device-names-in-proc-iomem.patch @@ -0,0 +1,45 @@ +From cab56b51ec0e69128909cef4650e1907248d821b Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Mon, 18 Jul 2022 17:06:47 +0200 +Subject: parisc: Fix device names in /proc/iomem + +From: Helge Deller + +commit cab56b51ec0e69128909cef4650e1907248d821b upstream. + +Fix the output of /proc/iomem to show the real hardware device name +including the pa_pathname, e.g. "Merlin 160 Core Centronics [8:16:0]". +Up to now only the pa_pathname ("[8:16.0]") was shown. + +Signed-off-by: Helge Deller +Cc: # v4.9+ +Signed-off-by: Greg Kroah-Hartman +--- + arch/parisc/kernel/drivers.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/arch/parisc/kernel/drivers.c ++++ b/arch/parisc/kernel/drivers.c +@@ -520,7 +520,6 @@ alloc_pa_dev(unsigned long hpa, struct h + dev->id.hversion_rev = iodc_data[1] & 0x0f; + dev->id.sversion = ((iodc_data[4] & 0x0f) << 16) | + (iodc_data[5] << 8) | iodc_data[6]; +- dev->hpa.name = parisc_pathname(dev); + dev->hpa.start = hpa; + /* This is awkward. The STI spec says that gfx devices may occupy + * 32MB or 64MB. Unfortunately, we don't know how to tell whether +@@ -534,10 +533,10 @@ alloc_pa_dev(unsigned long hpa, struct h + dev->hpa.end = hpa + 0xfff; + } + dev->hpa.flags = IORESOURCE_MEM; +- name = parisc_hardware_description(&dev->id); +- if (name) { +- strlcpy(dev->name, name, sizeof(dev->name)); +- } ++ dev->hpa.name = dev->name; ++ name = parisc_hardware_description(&dev->id) ? : "unknown"; ++ snprintf(dev->name, sizeof(dev->name), "%s [%s]", ++ name, parisc_pathname(dev)); + + /* Silently fail things like mouse ports which are subsumed within + * the keyboard controller diff --git a/queue-5.19/parisc-io_pgetevents_time64-needs-compat-syscall-in-32-bit-compat-mode.patch b/queue-5.19/parisc-io_pgetevents_time64-needs-compat-syscall-in-32-bit-compat-mode.patch new file mode 100644 index 00000000000..81785bec4cd --- /dev/null +++ b/queue-5.19/parisc-io_pgetevents_time64-needs-compat-syscall-in-32-bit-compat-mode.patch @@ -0,0 +1,36 @@ +From 6431e92fc827bdd2d28f79150d90415ba9ce0d21 Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Mon, 1 Aug 2022 17:36:15 +0200 +Subject: parisc: io_pgetevents_time64() needs compat syscall in 32-bit compat mode + +From: Helge Deller + +commit 6431e92fc827bdd2d28f79150d90415ba9ce0d21 upstream. + +For all syscalls in 32-bit compat mode on 64-bit kernels the upper +32-bits of the 64-bit registers are zeroed out, so a negative 32-bit +signed value will show up as positive 64-bit signed value. + +This behaviour breaks the io_pgetevents_time64() syscall which expects +signed 64-bit values for the "min_nr" and "nr" parameters. +Fix this by switching to the compat_sys_io_pgetevents_time64() syscall, +which uses "compat_long_t" types for those parameters. + +Cc: # v5.1+ +Signed-off-by: Helge Deller +Signed-off-by: Greg Kroah-Hartman +--- + arch/parisc/kernel/syscalls/syscall.tbl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/parisc/kernel/syscalls/syscall.tbl ++++ b/arch/parisc/kernel/syscalls/syscall.tbl +@@ -413,7 +413,7 @@ + 412 32 utimensat_time64 sys_utimensat sys_utimensat + 413 32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64 + 414 32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64 +-416 32 io_pgetevents_time64 sys_io_pgetevents sys_io_pgetevents ++416 32 io_pgetevents_time64 sys_io_pgetevents compat_sys_io_pgetevents_time64 + 417 32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64 + 418 32 mq_timedsend_time64 sys_mq_timedsend sys_mq_timedsend + 419 32 mq_timedreceive_time64 sys_mq_timedreceive sys_mq_timedreceive diff --git a/queue-5.19/risc-v-add-modules-to-virtual-kernel-memory-layout-dump.patch b/queue-5.19/risc-v-add-modules-to-virtual-kernel-memory-layout-dump.patch new file mode 100644 index 00000000000..8d483ae361d --- /dev/null +++ b/queue-5.19/risc-v-add-modules-to-virtual-kernel-memory-layout-dump.patch @@ -0,0 +1,45 @@ +From f9293ad46d8ba9909187a37b7215324420ad4596 Mon Sep 17 00:00:00 2001 +From: Xianting Tian +Date: Thu, 11 Aug 2022 15:41:48 +0800 +Subject: RISC-V: Add modules to virtual kernel memory layout dump + +From: Xianting Tian + +commit f9293ad46d8ba9909187a37b7215324420ad4596 upstream. + +Modules always live before the kernel, MODULES_END is fixed but +MODULES_VADDR isn't fixed, it depends on the kernel size. +Let's add it to virtual kernel memory layout dump. + +As MODULES is only defined for CONFIG_64BIT, so we dump it when +CONFIG_64BIT=y. + +eg, +MODULES_VADDR - MODULES_END +0xffffffff01133000 - 0xffffffff80000000 + +Reviewed-by: Guo Ren +Reviewed-by: Heiko Stuebner +Signed-off-by: Xianting Tian +Link: https://lore.kernel.org/r/20220811074150.3020189-5-xianting.tian@linux.alibaba.com +Cc: stable@vger.kernel.org +Fixes: 2bfc6cd81bd1 ("riscv: Move kernel mapping outside of linear mapping") +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/mm/init.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/riscv/mm/init.c ++++ b/arch/riscv/mm/init.c +@@ -135,6 +135,10 @@ static void __init print_vm_layout(void) + (unsigned long)VMEMMAP_END); + print_ml("vmalloc", (unsigned long)VMALLOC_START, + (unsigned long)VMALLOC_END); ++#ifdef CONFIG_64BIT ++ print_ml("modules", (unsigned long)MODULES_VADDR, ++ (unsigned long)MODULES_END); ++#endif + print_ml("lowmem", (unsigned long)PAGE_OFFSET, + (unsigned long)high_memory); + if (IS_ENABLED(CONFIG_64BIT)) { diff --git a/queue-5.19/risc-v-cpu_ops_spinwait.c-should-include-head.h.patch b/queue-5.19/risc-v-cpu_ops_spinwait.c-should-include-head.h.patch new file mode 100644 index 00000000000..2c3406efede --- /dev/null +++ b/queue-5.19/risc-v-cpu_ops_spinwait.c-should-include-head.h.patch @@ -0,0 +1,36 @@ +From e4aa991c05aedc3ead92d1352af86db74090dc3c Mon Sep 17 00:00:00 2001 +From: Ben Dooks +Date: Wed, 13 Jul 2022 22:53:06 +0100 +Subject: RISC-V: cpu_ops_spinwait.c should include head.h + +From: Ben Dooks + +commit e4aa991c05aedc3ead92d1352af86db74090dc3c upstream. + +Running sparse shows cpu_ops_spinwait.c is missing two definitions +found in head.h, so include it to stop the following warnings: + +arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static? +arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static? + +Signed-off-by: Ben Dooks +Link: https://lore.kernel.org/r/20220713215306.94675-1-ben.dooks@sifive.com +Fixes: c78f94f35cf6 ("RISC-V: Use __cpu_up_stack/task_pointer only for spinwait method") +Cc: stable@vger.kernel.org +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/kernel/cpu_ops_spinwait.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/riscv/kernel/cpu_ops_spinwait.c ++++ b/arch/riscv/kernel/cpu_ops_spinwait.c +@@ -11,6 +11,8 @@ + #include + #include + ++#include "head.h" ++ + const struct cpu_operations cpu_ops_spinwait; + void *__cpu_spinwait_stack_pointer[NR_CPUS] __section(".data"); + void *__cpu_spinwait_task_pointer[NR_CPUS] __section(".data"); diff --git a/queue-5.19/risc-v-declare-cpu_ops_spinwait-in-asm-cpu_ops.h.patch b/queue-5.19/risc-v-declare-cpu_ops_spinwait-in-asm-cpu_ops.h.patch new file mode 100644 index 00000000000..38c86100e97 --- /dev/null +++ b/queue-5.19/risc-v-declare-cpu_ops_spinwait-in-asm-cpu_ops.h.patch @@ -0,0 +1,50 @@ +From da6d2128e56a50a0d497c8e41ca1d33d88bcc0aa Mon Sep 17 00:00:00 2001 +From: Ben Dooks +Date: Thu, 14 Jul 2022 08:18:11 +0100 +Subject: RISC-V: Declare cpu_ops_spinwait in + +From: Ben Dooks + +commit da6d2128e56a50a0d497c8e41ca1d33d88bcc0aa upstream. + +The cpu_ops_spinwait is used in a couple of places in arch/riscv +and is causing a sparse warning due to no declaration. Add this +to with the others to fix the following: + +arch/riscv/kernel/cpu_ops_spinwait.c:16:29: warning: symbol 'cpu_ops_spinwait' was not declared. Should it be static? + +Signed-off-by: Ben Dooks +Link: https://lore.kernel.org/r/20220714071811.187491-1-ben.dooks@sifive.com +[Palmer: Drop the extern from cpu_ops.c] +Fixes: 2ffc48fc7071 ("RISC-V: Move spinwait booting method to its own config") +Cc: stable@vger.kernel.org +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/include/asm/cpu_ops.h | 1 + + arch/riscv/kernel/cpu_ops.c | 4 +--- + 2 files changed, 2 insertions(+), 3 deletions(-) + +--- a/arch/riscv/include/asm/cpu_ops.h ++++ b/arch/riscv/include/asm/cpu_ops.h +@@ -38,6 +38,7 @@ struct cpu_operations { + #endif + }; + ++extern const struct cpu_operations cpu_ops_spinwait; + extern const struct cpu_operations *cpu_ops[NR_CPUS]; + void __init cpu_set_ops(int cpu); + +--- a/arch/riscv/kernel/cpu_ops.c ++++ b/arch/riscv/kernel/cpu_ops.c +@@ -15,9 +15,7 @@ + const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init; + + extern const struct cpu_operations cpu_ops_sbi; +-#ifdef CONFIG_RISCV_BOOT_SPINWAIT +-extern const struct cpu_operations cpu_ops_spinwait; +-#else ++#ifndef CONFIG_RISCV_BOOT_SPINWAIT + const struct cpu_operations cpu_ops_spinwait = { + .name = "", + .cpu_prepare = NULL, diff --git a/queue-5.19/risc-v-fix-counter-restart-during-overflow-for-rv32.patch b/queue-5.19/risc-v-fix-counter-restart-during-overflow-for-rv32.patch new file mode 100644 index 00000000000..37d02d507af --- /dev/null +++ b/queue-5.19/risc-v-fix-counter-restart-during-overflow-for-rv32.patch @@ -0,0 +1,39 @@ +From acc1b919f47926b089be21b8aaa29ec91fef0aa2 Mon Sep 17 00:00:00 2001 +From: Atish Patra +Date: Mon, 11 Jul 2022 10:46:28 -0700 +Subject: RISC-V: Fix counter restart during overflow for RV32 + +From: Atish Patra + +commit acc1b919f47926b089be21b8aaa29ec91fef0aa2 upstream. + +Pass the upper half of the initial value of the counter correctly +for RV32. + +Fixes: 4905ec2fb7e6 ("RISC-V: Add sscofpmf extension support") +Signed-off-by: Atish Patra +Reviewed-by: Guo Ren +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220711174632.4186047-2-atishp@rivosinc.com +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + drivers/perf/riscv_pmu_sbi.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/perf/riscv_pmu_sbi.c ++++ b/drivers/perf/riscv_pmu_sbi.c +@@ -525,8 +525,13 @@ static inline void pmu_sbi_start_overflo + hwc = &event->hw; + max_period = riscv_pmu_ctr_get_width_mask(event); + init_val = local64_read(&hwc->prev_count) & max_period; ++#if defined(CONFIG_32BIT) ++ sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_START, idx, 1, ++ flag, init_val, init_val >> 32, 0); ++#else + sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_START, idx, 1, + flag, init_val, 0, 0); ++#endif + } + ctr_ovf_mask = ctr_ovf_mask >> 1; + idx++; diff --git a/queue-5.19/risc-v-fix-sbi-pmu-calls-for-rv32.patch b/queue-5.19/risc-v-fix-sbi-pmu-calls-for-rv32.patch new file mode 100644 index 00000000000..dbb7d0a02e7 --- /dev/null +++ b/queue-5.19/risc-v-fix-sbi-pmu-calls-for-rv32.patch @@ -0,0 +1,57 @@ +From 0209b5830bea42dd3ce33ab0397231e67ec3b751 Mon Sep 17 00:00:00 2001 +From: Atish Patra +Date: Mon, 11 Jul 2022 10:46:30 -0700 +Subject: RISC-V: Fix SBI PMU calls for RV32 + +From: Atish Patra + +commit 0209b5830bea42dd3ce33ab0397231e67ec3b751 upstream. + +Some of the SBI PMU calls does not pass 64bit arguments +correctly and not under RV32 compile time flags. Currently, +this doesn't create any incorrect results as RV64 ignores +any value in the additional register and qemu doesn't support +raw events. + +Fix those SBI calls in order to set correct values for RV32. + +Fixes: e9991434596f ("RISC-V: Add perf platform driver based on SBI PMU extension") +Signed-off-by: Atish Patra +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220711174632.4186047-4-atishp@rivosinc.com +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + drivers/perf/riscv_pmu_sbi.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/perf/riscv_pmu_sbi.c ++++ b/drivers/perf/riscv_pmu_sbi.c +@@ -274,8 +274,13 @@ static int pmu_sbi_ctr_get_idx(struct pe + cflags |= SBI_PMU_CFG_FLAG_SET_UINH; + + /* retrieve the available counter index */ ++#if defined(CONFIG_32BIT) ++ ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_CFG_MATCH, cbase, cmask, ++ cflags, hwc->event_base, hwc->config, hwc->config >> 32); ++#else + ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_CFG_MATCH, cbase, cmask, + cflags, hwc->event_base, hwc->config, 0); ++#endif + if (ret.error) { + pr_debug("Not able to find a counter for event %lx config %llx\n", + hwc->event_base, hwc->config); +@@ -417,8 +422,13 @@ static void pmu_sbi_ctr_start(struct per + struct hw_perf_event *hwc = &event->hw; + unsigned long flag = SBI_PMU_START_FLAG_SET_INIT_VALUE; + ++#if defined(CONFIG_32BIT) + ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_START, hwc->idx, + 1, flag, ival, ival >> 32, 0); ++#else ++ ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_START, hwc->idx, ++ 1, flag, ival, 0, 0); ++#endif + if (ret.error && (ret.error != SBI_ERR_ALREADY_STARTED)) + pr_err("Starting counter idx %d failed with error %d\n", + hwc->idx, sbi_err_map_linux_errno(ret.error)); diff --git a/queue-5.19/risc-v-fixup-get-incorrect-user-mode-pc-for-kernel-mode-regs.patch b/queue-5.19/risc-v-fixup-get-incorrect-user-mode-pc-for-kernel-mode-regs.patch new file mode 100644 index 00000000000..1cbad85fcc5 --- /dev/null +++ b/queue-5.19/risc-v-fixup-get-incorrect-user-mode-pc-for-kernel-mode-regs.patch @@ -0,0 +1,99 @@ +From 59c026c359c30f116fef6ee958e24d04983efbb0 Mon Sep 17 00:00:00 2001 +From: Xianting Tian +Date: Thu, 11 Aug 2022 15:41:46 +0800 +Subject: RISC-V: Fixup get incorrect user mode PC for kernel mode regs + +From: Xianting Tian + +commit 59c026c359c30f116fef6ee958e24d04983efbb0 upstream. + +When use 'echo c > /proc/sysrq-trigger' to trigger kdump, riscv_crash_save_regs() +will be called to save regs for vmcore, we found "epc" value 00ffffffa5537400 +is not a valid kernel virtual address, but is a user virtual address. Other +regs(eg, ra, sp, gp...) are correct kernel virtual address. +Actually 0x00ffffffb0dd9400 is the user mode PC of 'PID: 113 Comm: sh', which +is saved in the task's stack. + +[ 21.201701] CPU: 0 PID: 113 Comm: sh Kdump: loaded Not tainted 5.18.9 #45 +[ 21.201979] Hardware name: riscv-virtio,qemu (DT) +[ 21.202160] epc : 00ffffffa5537400 ra : ffffffff80088640 sp : ff20000010333b90 +[ 21.202435] gp : ffffffff810dde38 tp : ff6000000226c200 t0 : ffffffff8032be7c +[ 21.202707] t1 : 0720072007200720 t2 : 30203a7375746174 s0 : ff20000010333cf0 +[ 21.202973] s1 : 0000000000000000 a0 : ff20000010333b98 a1 : 0000000000000001 +[ 21.203243] a2 : 0000000000000010 a3 : 0000000000000000 a4 : 28c8f0aeffea4e00 +[ 21.203519] a5 : 28c8f0aeffea4e00 a6 : 0000000000000009 a7 : ffffffff8035c9b8 +[ 21.203794] s2 : ffffffff810df0a8 s3 : ffffffff810df718 s4 : ff20000010333b98 +[ 21.204062] s5 : 0000000000000000 s6 : 0000000000000007 s7 : ffffffff80c4a468 +[ 21.204331] s8 : 00ffffffef451410 s9 : 0000000000000007 s10: 00aaaaaac0510700 +[ 21.204606] s11: 0000000000000001 t3 : ff60000001218f00 t4 : ff60000001218f00 +[ 21.204876] t5 : ff60000001218000 t6 : ff200000103338b8 +[ 21.205079] status: 0000000200000020 badaddr: 0000000000000000 cause: 0000000000000008 + +With the incorrect PC, the backtrace showed by crash tool as below, the first +stack frame is abnormal, + +crash> bt +PID: 113 TASK: ff60000002269600 CPU: 0 COMMAND: "sh" + #0 [ff2000001039bb90] __efistub_.Ldebug_info0 at 00ffffffa5537400 <-- Abnormal + #1 [ff2000001039bcf0] panic at ffffffff806578ba + #2 [ff2000001039bd50] sysrq_reset_seq_param_set at ffffffff8038c030 + #3 [ff2000001039bda0] __handle_sysrq at ffffffff8038c5f8 + #4 [ff2000001039be00] write_sysrq_trigger at ffffffff8038cad8 + #5 [ff2000001039be20] proc_reg_write at ffffffff801b7edc + #6 [ff2000001039be40] vfs_write at ffffffff80152ba6 + #7 [ff2000001039be80] ksys_write at ffffffff80152ece + #8 [ff2000001039bed0] sys_write at ffffffff80152f46 + +With the patch, we can get current kernel mode PC, the output as below, + +[ 17.607658] CPU: 0 PID: 113 Comm: sh Kdump: loaded Not tainted 5.18.9 #42 +[ 17.607937] Hardware name: riscv-virtio,qemu (DT) +[ 17.608150] epc : ffffffff800078f8 ra : ffffffff8008862c sp : ff20000010333b90 +[ 17.608441] gp : ffffffff810dde38 tp : ff6000000226c200 t0 : ffffffff8032be68 +[ 17.608741] t1 : 0720072007200720 t2 : 666666666666663c s0 : ff20000010333cf0 +[ 17.609025] s1 : 0000000000000000 a0 : ff20000010333b98 a1 : 0000000000000001 +[ 17.609320] a2 : 0000000000000010 a3 : 0000000000000000 a4 : 0000000000000000 +[ 17.609601] a5 : ff60000001c78000 a6 : 000000000000003c a7 : ffffffff8035c9a4 +[ 17.609894] s2 : ffffffff810df0a8 s3 : ffffffff810df718 s4 : ff20000010333b98 +[ 17.610186] s5 : 0000000000000000 s6 : 0000000000000007 s7 : ffffffff80c4a468 +[ 17.610469] s8 : 00ffffffca281410 s9 : 0000000000000007 s10: 00aaaaaab5bb6700 +[ 17.610755] s11: 0000000000000001 t3 : ff60000001218f00 t4 : ff60000001218f00 +[ 17.611041] t5 : ff60000001218000 t6 : ff20000010333988 +[ 17.611255] status: 0000000200000020 badaddr: 0000000000000000 cause: 0000000000000008 + +With the correct PC, the backtrace showed by crash tool as below, + +crash> bt +PID: 113 TASK: ff6000000226c200 CPU: 0 COMMAND: "sh" + #0 [ff20000010333b90] riscv_crash_save_regs at ffffffff800078f8 <--- Normal + #1 [ff20000010333cf0] panic at ffffffff806578c6 + #2 [ff20000010333d50] sysrq_reset_seq_param_set at ffffffff8038c03c + #3 [ff20000010333da0] __handle_sysrq at ffffffff8038c604 + #4 [ff20000010333e00] write_sysrq_trigger at ffffffff8038cae4 + #5 [ff20000010333e20] proc_reg_write at ffffffff801b7ee8 + #6 [ff20000010333e40] vfs_write at ffffffff80152bb2 + #7 [ff20000010333e80] ksys_write at ffffffff80152eda + #8 [ff20000010333ed0] sys_write at ffffffff80152f52 + +Fixes: e53d28180d4d ("RISC-V: Add kdump support") +Co-developed-by: Guo Ren +Signed-off-by: Xianting Tian +Link: https://lore.kernel.org/r/20220811074150.3020189-3-xianting.tian@linux.alibaba.com +Cc: stable@vger.kernel.org +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/kernel/crash_save_regs.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/riscv/kernel/crash_save_regs.S ++++ b/arch/riscv/kernel/crash_save_regs.S +@@ -44,7 +44,7 @@ SYM_CODE_START(riscv_crash_save_regs) + REG_S t6, PT_T6(a0) /* x31 */ + + csrr t1, CSR_STATUS +- csrr t2, CSR_EPC ++ auipc t2, 0x0 + csrr t3, CSR_TVAL + csrr t4, CSR_CAUSE + diff --git a/queue-5.19/risc-v-fixup-schedule-out-issue-in-machine_crash_shutdown.patch b/queue-5.19/risc-v-fixup-schedule-out-issue-in-machine_crash_shutdown.patch new file mode 100644 index 00000000000..b4190c1b25f --- /dev/null +++ b/queue-5.19/risc-v-fixup-schedule-out-issue-in-machine_crash_shutdown.patch @@ -0,0 +1,114 @@ +From ad943893d5f1d0aeea892bf7b781cf8062b36d58 Mon Sep 17 00:00:00 2001 +From: Xianting Tian +Date: Thu, 11 Aug 2022 15:41:47 +0800 +Subject: RISC-V: Fixup schedule out issue in machine_crash_shutdown() + +From: Xianting Tian + +commit ad943893d5f1d0aeea892bf7b781cf8062b36d58 upstream. + +Current task of executing crash kexec will be schedule out when panic is +triggered by RCU Stall, as it needs to wait rcu completion. It lead to +inability to enter the crash system. + +The implementation of machine_crash_shutdown() is non-standard for RISC-V +according to other Arch's implementation(eg, x86, arm64), we need to send +IPI to stop secondary harts. + +[224521.877268] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: +[224521.883471] rcu: 0-...0: (3 GPs behind) idle=cfa/0/0x1 softirq=3968793/3968793 fqs=2495 +[224521.891742] (detected by 2, t=5255 jiffies, g=60855593, q=328) +[224521.897754] Task dump for CPU 0: +[224521.901074] task:swapper/0 state:R running task stack: 0 pid: 0 ppid: 0 flags:0x00000008 +[224521.911090] Call Trace: +[224521.913638] [] __schedule+0x208/0x5ea +[224521.918957] Kernel panic - not syncing: RCU Stall +[224521.923773] bad: scheduling from the idle thread! +[224521.928571] CPU: 2 PID: 0 Comm: swapper/2 Kdump: loaded Tainted: G O 5.10.113-yocto-standard #1 +[224521.938658] Call Trace: +[224521.941200] [] walk_stackframe+0x0/0xaa +[224521.946689] [] show_stack+0x32/0x3e +[224521.951830] [] dump_stack_lvl+0x7e/0xa2 +[224521.957317] [] dump_stack+0x14/0x1c +[224521.962459] [] dequeue_task_idle+0x2c/0x40 +[224521.968207] [] __schedule+0x41e/0x5ea +[224521.973520] [] schedule+0x34/0xe4 +[224521.978487] [] schedule_timeout+0xc6/0x170 +[224521.984234] [] wait_for_completion+0x98/0xf2 +[224521.990157] [] __wait_rcu_gp+0x148/0x14a +[224521.995733] [] synchronize_rcu+0x5c/0x66 +[224522.001307] [] rcu_sync_enter+0x54/0xe6 +[224522.006795] [] percpu_down_write+0x32/0x11c +[224522.012629] [] _cpu_down+0x92/0x21a +[224522.017771] [] smp_shutdown_nonboot_cpus+0x90/0x118 +[224522.024299] [] machine_crash_shutdown+0x30/0x4a +[224522.030483] [] __crash_kexec+0x62/0xa6 +[224522.035884] [] panic+0xfa/0x2b6 +[224522.040678] [] rcu_sched_clock_irq+0xc26/0xcb8 +[224522.046774] [] update_process_times+0x62/0x8a +[224522.052785] [] tick_sched_timer+0x9e/0x102 +[224522.058533] [] __hrtimer_run_queues+0x16a/0x318 +[224522.064716] [] hrtimer_interrupt+0xd4/0x228 +[224522.070551] [] riscv_timer_interrupt+0x3c/0x48 +[224522.076646] [] handle_percpu_devid_irq+0xb0/0x24c +[224522.083004] [] __handle_domain_irq+0xa8/0x122 +[224522.089014] [] riscv_intc_irq+0x38/0x60 +[224522.094501] [] ret_from_exception+0x0/0xc +[224522.100161] [] rcu_eqs_enter.constprop.0+0x8c/0xb8 + +With the patch, it can enter crash system when RCU Stall occur. + +Fixes: e53d28180d4d ("RISC-V: Add kdump support") +Signed-off-by: Xianting Tian +Link: https://lore.kernel.org/r/20220811074150.3020189-4-xianting.tian@linux.alibaba.com +Cc: stable@vger.kernel.org +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/kernel/machine_kexec.c | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +--- a/arch/riscv/kernel/machine_kexec.c ++++ b/arch/riscv/kernel/machine_kexec.c +@@ -138,19 +138,37 @@ void machine_shutdown(void) + #endif + } + ++/* Override the weak function in kernel/panic.c */ ++void crash_smp_send_stop(void) ++{ ++ static int cpus_stopped; ++ ++ /* ++ * This function can be called twice in panic path, but obviously ++ * we execute this only once. ++ */ ++ if (cpus_stopped) ++ return; ++ ++ smp_send_stop(); ++ cpus_stopped = 1; ++} ++ + /* + * machine_crash_shutdown - Prepare to kexec after a kernel crash + * + * This function is called by crash_kexec just before machine_kexec +- * below and its goal is similar to machine_shutdown, but in case of +- * a kernel crash. Since we don't handle such cases yet, this function +- * is empty. ++ * and its goal is to shutdown non-crashing cpus and save registers. + */ + void + machine_crash_shutdown(struct pt_regs *regs) + { ++ local_irq_disable(); ++ ++ /* shutdown non-crashing cpus */ ++ crash_smp_send_stop(); ++ + crash_save_cpu(regs, smp_processor_id()); +- machine_shutdown(); + pr_info("Starting crashdump kernel...\n"); + } + diff --git a/queue-5.19/risc-v-kexec-fixup-use-of-smp_processor_id-in-preemptible-context.patch b/queue-5.19/risc-v-kexec-fixup-use-of-smp_processor_id-in-preemptible-context.patch new file mode 100644 index 00000000000..e89a1e64cbf --- /dev/null +++ b/queue-5.19/risc-v-kexec-fixup-use-of-smp_processor_id-in-preemptible-context.patch @@ -0,0 +1,80 @@ +From 357628e68f5c08ad578a718dc62a0031e06dbe91 Mon Sep 17 00:00:00 2001 +From: Xianting Tian +Date: Thu, 11 Aug 2022 15:41:45 +0800 +Subject: RISC-V: kexec: Fixup use of smp_processor_id() in preemptible context + +From: Xianting Tian + +commit 357628e68f5c08ad578a718dc62a0031e06dbe91 upstream. + +Use __smp_processor_id() to avoid check the preemption context when +CONFIG_DEBUG_PREEMPT enabled, as we will enter crash kernel and no +return. + +Without the patch, +[ 103.781044] sysrq: Trigger a crash +[ 103.784625] Kernel panic - not syncing: sysrq triggered crash +[ 103.837634] CPU1: off +[ 103.889668] CPU2: off +[ 103.933479] CPU3: off +[ 103.939424] Starting crashdump kernel... +[ 103.943442] BUG: using smp_processor_id() in preemptible [00000000] code: sh/346 +[ 103.950884] caller is debug_smp_processor_id+0x1c/0x26 +[ 103.956051] CPU: 0 PID: 346 Comm: sh Kdump: loaded Not tainted 5.10.113-00002-gce03f03bf4ec-dirty #149 +[ 103.965355] Call Trace: +[ 103.967805] [] walk_stackframe+0x0/0xa2 +[ 103.973206] [] show_stack+0x32/0x3e +[ 103.978258] [] dump_stack_lvl+0x72/0x8e +[ 103.983655] [] dump_stack+0x14/0x1c +[ 103.988705] [] check_preemption_disabled+0x9e/0xaa +[ 103.995057] [] debug_smp_processor_id+0x1c/0x26 +[ 104.001150] [] machine_kexec+0x22/0xd0 +[ 104.006463] [] __crash_kexec+0x6a/0xa4 +[ 104.011774] [] panic+0xfc/0x2b0 +[ 104.016480] [] sysrq_reset_seq_param_set+0x0/0x70 +[ 104.022745] [] __handle_sysrq+0x8c/0x154 +[ 104.028229] [] write_sysrq_trigger+0x5a/0x6a +[ 104.034061] [] proc_reg_write+0x58/0xd4 +[ 104.039459] [] vfs_write+0x7e/0x254 +[ 104.044509] [] ksys_write+0x58/0xbe +[ 104.049558] [] sys_write+0xe/0x16 +[ 104.054434] [] ret_from_syscall+0x0/0x2 +[ 104.067863] Will call new kernel at ecc00000 from hart id 0 +[ 104.074939] FDT image at fc5ee000 +[ 104.079523] Bye... + +With the patch we can got clear output, +[ 67.740553] sysrq: Trigger a crash +[ 67.744166] Kernel panic - not syncing: sysrq triggered crash +[ 67.809123] CPU1: off +[ 67.865210] CPU2: off +[ 67.909075] CPU3: off +[ 67.919123] Starting crashdump kernel... +[ 67.924900] Will call new kernel at ecc00000 from hart id 0 +[ 67.932045] FDT image at fc5ee000 +[ 67.935560] Bye... + +Fixes: 0e105f1d0037 ("riscv: use hart id instead of cpu id on machine_kexec") +Reviewed-by: Guo Ren +Reviewed-by: Heiko Stuebner +Reviewed-by: Atish Patra +Signed-off-by: Xianting Tian +Link: https://lore.kernel.org/r/20220811074150.3020189-2-xianting.tian@linux.alibaba.com +Cc: stable@vger.kernel.org +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/kernel/machine_kexec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/riscv/kernel/machine_kexec.c ++++ b/arch/riscv/kernel/machine_kexec.c +@@ -171,7 +171,7 @@ machine_kexec(struct kimage *image) + struct kimage_arch *internal = &image->arch; + unsigned long jump_addr = (unsigned long) image->start; + unsigned long first_ind_entry = (unsigned long) &image->head; +- unsigned long this_cpu_id = smp_processor_id(); ++ unsigned long this_cpu_id = __smp_processor_id(); + unsigned long this_hart_id = cpuid_to_hartid_map(this_cpu_id); + unsigned long fdt_addr = internal->fdt_addr; + void *control_code_buffer = page_address(image->control_code_page); diff --git a/queue-5.19/risc-v-update-user-page-mapping-only-once-during-start.patch b/queue-5.19/risc-v-update-user-page-mapping-only-once-during-start.patch new file mode 100644 index 00000000000..f4cee616a0d --- /dev/null +++ b/queue-5.19/risc-v-update-user-page-mapping-only-once-during-start.patch @@ -0,0 +1,50 @@ +From 133a6d1fe7d7ad8393af025c4dde379c0616661f Mon Sep 17 00:00:00 2001 +From: Atish Patra +Date: Mon, 11 Jul 2022 10:46:29 -0700 +Subject: RISC-V: Update user page mapping only once during start + +From: Atish Patra + +commit 133a6d1fe7d7ad8393af025c4dde379c0616661f upstream. + +Currently, riscv_pmu_event_set_period updates the userpage mapping. +However, the caller of riscv_pmu_event_set_period should update +the userpage mapping because the counter can not be updated/started +from set_period function in counter overflow path. + +Invoke the perf_event_update_userpage at the caller so that it +doesn't get invoked twice during counter start path. + +Fixes: f5bfa23f576f ("RISC-V: Add a perf core library for pmu drivers") +Reviewed-by: Anup Patel +Signed-off-by: Atish Patra +Reviewed-by: Guo Ren +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220711174632.4186047-3-atishp@rivosinc.com +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + drivers/perf/riscv_pmu.c | 1 - + drivers/perf/riscv_pmu_sbi.c | 1 + + 2 files changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/perf/riscv_pmu.c ++++ b/drivers/perf/riscv_pmu.c +@@ -170,7 +170,6 @@ int riscv_pmu_event_set_period(struct pe + left = (max_period >> 1); + + local64_set(&hwc->prev_count, (u64)-left); +- perf_event_update_userpage(event); + + return overflow; + } +--- a/drivers/perf/riscv_pmu_sbi.c ++++ b/drivers/perf/riscv_pmu_sbi.c +@@ -542,6 +542,7 @@ static inline void pmu_sbi_start_overflo + sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_START, idx, 1, + flag, init_val, 0, 0); + #endif ++ perf_event_update_userpage(event); + } + ctr_ovf_mask = ctr_ovf_mask >> 1; + idx++; diff --git a/queue-5.19/riscv-dts-starfive-correct-number-of-external-interrupts.patch b/queue-5.19/riscv-dts-starfive-correct-number-of-external-interrupts.patch new file mode 100644 index 00000000000..a1b3a700fc3 --- /dev/null +++ b/queue-5.19/riscv-dts-starfive-correct-number-of-external-interrupts.patch @@ -0,0 +1,39 @@ +From a208acf0eac857dc8cdaddd63a4e18ed03f91786 Mon Sep 17 00:00:00 2001 +From: Mark Kettenis +Date: Thu, 7 Jul 2022 20:55:28 +0200 +Subject: riscv: dts: starfive: correct number of external interrupts + +From: Mark Kettenis + +commit a208acf0eac857dc8cdaddd63a4e18ed03f91786 upstream. + +The PLIC integrated on the Vic_U7_Core integrated on the StarFive +JH7100 SoC actually supports 133 external interrupts. 127 of these +are exposed to the outside world; the remainder are used by other +devices that are part of the core-complex such as the L2 cache +controller. But all 133 interrupts are external interrupts as far +as the PLIC is concerned. Fix the property so that the driver can +manage these additional interrupts, which is important since the +interrupts for the L2 cache controller are enabled by default. + +Fixes: ec85362fb121 ("RISC-V: Add initial StarFive JH7100 device tree") +Signed-off-by: Mark Kettenis +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220707185529.19509-1-kettenis@openbsd.org +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/boot/dts/starfive/jh7100.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/riscv/boot/dts/starfive/jh7100.dtsi ++++ b/arch/riscv/boot/dts/starfive/jh7100.dtsi +@@ -118,7 +118,7 @@ + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; +- riscv,ndev = <127>; ++ riscv,ndev = <133>; + }; + + clkgen: clock-controller@11800000 { diff --git a/queue-5.19/riscv-lib-uaccess-fix-csr_status-sr_sum-bit.patch b/queue-5.19/riscv-lib-uaccess-fix-csr_status-sr_sum-bit.patch new file mode 100644 index 00000000000..719478961b7 --- /dev/null +++ b/queue-5.19/riscv-lib-uaccess-fix-csr_status-sr_sum-bit.patch @@ -0,0 +1,48 @@ +From c08b4848f596fd95543197463b5162bd7bab2442 Mon Sep 17 00:00:00 2001 +From: Chen Lifu +Date: Wed, 15 Jun 2022 09:47:14 +0800 +Subject: riscv: lib: uaccess: fix CSR_STATUS SR_SUM bit + +From: Chen Lifu + +commit c08b4848f596fd95543197463b5162bd7bab2442 upstream. + +Since commit 5d8544e2d007 ("RISC-V: Generic library routines and assembly") +and commit ebcbd75e3962 ("riscv: Fix the bug in memory access fixup code"), +if __clear_user and __copy_user return from an fixup branch, +CSR_STATUS SR_SUM bit will be set, it is a vulnerability, so that +S-mode memory accesses to pages that are accessible by U-mode will success. +Disable S-mode access to U-mode memory should clear SR_SUM bit. + +Fixes: 5d8544e2d007 ("RISC-V: Generic library routines and assembly") +Fixes: ebcbd75e3962 ("riscv: Fix the bug in memory access fixup code") +Signed-off-by: Chen Lifu +Reviewed-by: Ben Dooks +Link: https://lore.kernel.org/r/20220615014714.1650349-1-chenlifu@huawei.com +Cc: stable@vger.kernel.org +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/lib/uaccess.S | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/riscv/lib/uaccess.S ++++ b/arch/riscv/lib/uaccess.S +@@ -175,7 +175,7 @@ ENTRY(__asm_copy_from_user) + /* Exception fixup code */ + 10: + /* Disable access to user memory */ +- csrs CSR_STATUS, t6 ++ csrc CSR_STATUS, t6 + mv a0, t5 + ret + ENDPROC(__asm_copy_to_user) +@@ -227,7 +227,7 @@ ENTRY(__clear_user) + /* Exception fixup code */ + 11: + /* Disable access to user memory */ +- csrs CSR_STATUS, t6 ++ csrc CSR_STATUS, t6 + mv a0, a1 + ret + ENDPROC(__clear_user) diff --git a/queue-5.19/riscv-uprobe-fix-sr_spie-set-clear-handling.patch b/queue-5.19/riscv-uprobe-fix-sr_spie-set-clear-handling.patch new file mode 100644 index 00000000000..d5191942c95 --- /dev/null +++ b/queue-5.19/riscv-uprobe-fix-sr_spie-set-clear-handling.patch @@ -0,0 +1,73 @@ +From 3dbe5829408bc1586f75b4667ef60e5aab0209c7 Mon Sep 17 00:00:00 2001 +From: Yipeng Zou +Date: Thu, 21 Jul 2022 14:58:20 +0800 +Subject: riscv:uprobe fix SR_SPIE set/clear handling + +From: Yipeng Zou + +commit 3dbe5829408bc1586f75b4667ef60e5aab0209c7 upstream. + +In riscv the process of uprobe going to clear spie before exec +the origin insn,and set spie after that.But When access the page +which origin insn has been placed a page fault may happen and +irq was disabled in arch_uprobe_pre_xol function,It cause a WARN +as follows. +There is no need to clear/set spie in arch_uprobe_pre/post/abort_xol. +We can just remove it. + +[ 31.684157] BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1488 +[ 31.684677] in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 76, name: work +[ 31.684929] preempt_count: 0, expected: 0 +[ 31.685969] CPU: 2 PID: 76 Comm: work Tainted: G +[ 31.686542] Hardware name: riscv-virtio,qemu (DT) +[ 31.686797] Call Trace: +[ 31.687053] [] dump_backtrace+0x30/0x38 +[ 31.687699] [] show_stack+0x40/0x4c +[ 31.688141] [] dump_stack_lvl+0x44/0x5c +[ 31.688396] [] dump_stack+0x18/0x20 +[ 31.688653] [] __might_resched+0x114/0x122 +[ 31.688948] [] __might_sleep+0x50/0x7a +[ 31.689435] [] down_read+0x30/0x130 +[ 31.689728] [] do_page_fault+0x166/x446 +[ 31.689997] [] ret_from_exception+0x0/0xc + +Fixes: 74784081aac8 ("riscv: Add uprobes supported") +Signed-off-by: Yipeng Zou +Reviewed-by: Guo Ren +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220721065820.245755-1-zouyipeng@huawei.com +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/kernel/probes/uprobes.c | 6 ------ + 1 file changed, 6 deletions(-) + +--- a/arch/riscv/kernel/probes/uprobes.c ++++ b/arch/riscv/kernel/probes/uprobes.c +@@ -59,8 +59,6 @@ int arch_uprobe_pre_xol(struct arch_upro + + instruction_pointer_set(regs, utask->xol_vaddr); + +- regs->status &= ~SR_SPIE; +- + return 0; + } + +@@ -72,8 +70,6 @@ int arch_uprobe_post_xol(struct arch_upr + + instruction_pointer_set(regs, utask->vaddr + auprobe->insn_size); + +- regs->status |= SR_SPIE; +- + return 0; + } + +@@ -111,8 +107,6 @@ void arch_uprobe_abort_xol(struct arch_u + * address. + */ + instruction_pointer_set(regs, utask->vaddr); +- +- regs->status &= ~SR_SPIE; + } + + bool arch_uretprobe_is_alive(struct return_instance *ret, enum rp_check ctx, diff --git a/queue-5.19/rtc-rx8025-fix-12-24-hour-mode-detection-on-rx-8035.patch b/queue-5.19/rtc-rx8025-fix-12-24-hour-mode-detection-on-rx-8035.patch new file mode 100644 index 00000000000..8761b918ef1 --- /dev/null +++ b/queue-5.19/rtc-rx8025-fix-12-24-hour-mode-detection-on-rx-8035.patch @@ -0,0 +1,108 @@ +From 71af91565052214ad86f288e0d8ffb165f790995 Mon Sep 17 00:00:00 2001 +From: Mathew McBride +Date: Wed, 6 Jul 2022 07:42:36 +0000 +Subject: rtc: rx8025: fix 12/24 hour mode detection on RX-8035 + +From: Mathew McBride + +commit 71af91565052214ad86f288e0d8ffb165f790995 upstream. + +The 12/24hr flag in the RX-8035 can be found in the hour register, +instead of the CTRL1 on the RX-8025. This was overlooked when +support for the RX-8035 was added, and was causing read errors when +the hour register 'overflowed'. + +To deal with the relevant register not always being visible in +the relevant functions, determine the 12/24 mode at startup and +store it in the driver state. + +Signed-off-by: Mathew McBride +Fixes: f120e2e33ac8 ("rtc: rx8025: implement RX-8035 support") +Cc: stable@vger.kernel.org +Signed-off-by: Alexandre Belloni +Link: https://lore.kernel.org/r/20220706074236.24011-1-matt@traverse.com.au +Signed-off-by: Greg Kroah-Hartman +--- + drivers/rtc/rtc-rx8025.c | 22 ++++++++++++++++++---- + 1 file changed, 18 insertions(+), 4 deletions(-) + +--- a/drivers/rtc/rtc-rx8025.c ++++ b/drivers/rtc/rtc-rx8025.c +@@ -55,6 +55,8 @@ + #define RX8025_BIT_CTRL2_XST BIT(5) + #define RX8025_BIT_CTRL2_VDET BIT(6) + ++#define RX8035_BIT_HOUR_1224 BIT(7) ++ + /* Clock precision adjustment */ + #define RX8025_ADJ_RESOLUTION 3050 /* in ppb */ + #define RX8025_ADJ_DATA_MAX 62 +@@ -78,6 +80,7 @@ struct rx8025_data { + struct rtc_device *rtc; + enum rx_model model; + u8 ctrl1; ++ int is_24; + }; + + static s32 rx8025_read_reg(const struct i2c_client *client, u8 number) +@@ -226,7 +229,7 @@ static int rx8025_get_time(struct device + + dt->tm_sec = bcd2bin(date[RX8025_REG_SEC] & 0x7f); + dt->tm_min = bcd2bin(date[RX8025_REG_MIN] & 0x7f); +- if (rx8025->ctrl1 & RX8025_BIT_CTRL1_1224) ++ if (rx8025->is_24) + dt->tm_hour = bcd2bin(date[RX8025_REG_HOUR] & 0x3f); + else + dt->tm_hour = bcd2bin(date[RX8025_REG_HOUR] & 0x1f) % 12 +@@ -254,7 +257,7 @@ static int rx8025_set_time(struct device + */ + date[RX8025_REG_SEC] = bin2bcd(dt->tm_sec); + date[RX8025_REG_MIN] = bin2bcd(dt->tm_min); +- if (rx8025->ctrl1 & RX8025_BIT_CTRL1_1224) ++ if (rx8025->is_24) + date[RX8025_REG_HOUR] = bin2bcd(dt->tm_hour); + else + date[RX8025_REG_HOUR] = (dt->tm_hour >= 12 ? 0x20 : 0) +@@ -279,6 +282,7 @@ static int rx8025_init_client(struct i2c + struct rx8025_data *rx8025 = i2c_get_clientdata(client); + u8 ctrl[2], ctrl2; + int need_clear = 0; ++ int hour_reg; + int err; + + err = rx8025_read_regs(client, RX8025_REG_CTRL1, 2, ctrl); +@@ -303,6 +307,16 @@ static int rx8025_init_client(struct i2c + + err = rx8025_write_reg(client, RX8025_REG_CTRL2, ctrl2); + } ++ ++ if (rx8025->model == model_rx_8035) { ++ /* In RX-8035, 12/24 flag is in the hour register */ ++ hour_reg = rx8025_read_reg(client, RX8025_REG_HOUR); ++ if (hour_reg < 0) ++ return hour_reg; ++ rx8025->is_24 = (hour_reg & RX8035_BIT_HOUR_1224); ++ } else { ++ rx8025->is_24 = (ctrl[1] & RX8025_BIT_CTRL1_1224); ++ } + out: + return err; + } +@@ -329,7 +343,7 @@ static int rx8025_read_alarm(struct devi + /* Hardware alarms precision is 1 minute! */ + t->time.tm_sec = 0; + t->time.tm_min = bcd2bin(ald[0] & 0x7f); +- if (rx8025->ctrl1 & RX8025_BIT_CTRL1_1224) ++ if (rx8025->is_24) + t->time.tm_hour = bcd2bin(ald[1] & 0x3f); + else + t->time.tm_hour = bcd2bin(ald[1] & 0x1f) % 12 +@@ -350,7 +364,7 @@ static int rx8025_set_alarm(struct devic + int err; + + ald[0] = bin2bcd(t->time.tm_min); +- if (rx8025->ctrl1 & RX8025_BIT_CTRL1_1224) ++ if (rx8025->is_24) + ald[1] = bin2bcd(t->time.tm_hour); + else + ald[1] = (t->time.tm_hour >= 12 ? 0x20 : 0) diff --git a/queue-5.19/series b/queue-5.19/series index 5fd879ba0df..1ed581d7bd3 100644 --- a/queue-5.19/series +++ b/queue-5.19/series @@ -60,3 +60,35 @@ usbnet-smsc95xx-fix-deadlock-on-runtime-resume.patch fix-short-copy-handling-in-copy_mc_pipe_to_iter.patch crypto-ccp-use-kzalloc-for-sev-ioctl-interfaces-to-prevent-kernel-memory-leak.patch ovl-drop-warn_on-dentry-is-null-in-ovl_encode_fh.patch +parisc-fix-device-names-in-proc-iomem.patch +parisc-drop-pa_swapper_pg_lock-spinlock.patch +parisc-check-the-return-value-of-ioremap-in-lba_driver_probe.patch +parisc-io_pgetevents_time64-needs-compat-syscall-in-32-bit-compat-mode.patch +riscv-uprobe-fix-sr_spie-set-clear-handling.patch +riscv-lib-uaccess-fix-csr_status-sr_sum-bit.patch +dt-bindings-riscv-fix-sifive-l2-cache-s-cache-sets.patch +riscv-dts-starfive-correct-number-of-external-interrupts.patch +risc-v-cpu_ops_spinwait.c-should-include-head.h.patch +risc-v-declare-cpu_ops_spinwait-in-asm-cpu_ops.h.patch +risc-v-kexec-fixup-use-of-smp_processor_id-in-preemptible-context.patch +risc-v-fixup-get-incorrect-user-mode-pc-for-kernel-mode-regs.patch +risc-v-fixup-schedule-out-issue-in-machine_crash_shutdown.patch +risc-v-add-modules-to-virtual-kernel-memory-layout-dump.patch +risc-v-fix-counter-restart-during-overflow-for-rv32.patch +risc-v-fix-sbi-pmu-calls-for-rv32.patch +risc-v-update-user-page-mapping-only-once-during-start.patch +wireguard-selftests-set-config_nonportable-on-riscv32.patch +rtc-rx8025-fix-12-24-hour-mode-detection-on-rx-8035.patch +drm-gem-properly-annotate-ww-context-on-drm_gem_lock_reservations-error.patch +drm-shmem-helper-add-missing-vunmap-on-error.patch +drm-vc4-hdmi-disable-audio-if-dmas-property-is-present-but-empty.patch +drm-ingenic-use-the-highest-possible-dma-burst-size.patch +drm-fb-helper-fix-out-of-bounds-access.patch +drm-hyperv-drm-include-framebuffer-and-edid-headers.patch +drm-dp-mst-read-the-extended-dpcd-capabilities-during-system-resume.patch +drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch +drm-nouveau-don-t-pm_runtime_put_sync-only-pm_runtime_put_autosuspend.patch +drm-nouveau-acpi-don-t-print-error-when-we-get-einprogress-from-pm_runtime.patch +drm-nouveau-kms-fix-failure-path-for-creating-dp-connectors.patch +drm-tegra-fix-vmapping-of-prime-buffers.patch +drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch diff --git a/queue-5.19/wireguard-selftests-set-config_nonportable-on-riscv32.patch b/queue-5.19/wireguard-selftests-set-config_nonportable-on-riscv32.patch new file mode 100644 index 00000000000..0699c8ed0c3 --- /dev/null +++ b/queue-5.19/wireguard-selftests-set-config_nonportable-on-riscv32.patch @@ -0,0 +1,32 @@ +From 9019b4f6d9bd88524ecd95420cf9cd4aaed7a125 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Tue, 9 Aug 2022 16:57:57 +0200 +Subject: wireguard: selftests: set CONFIG_NONPORTABLE on riscv32 + +From: Jason A. Donenfeld + +commit 9019b4f6d9bd88524ecd95420cf9cd4aaed7a125 upstream. + +When the CONFIG_PORTABLE/CONFIG_NONPORTABLE switches were added, various +configs were updated, but the wireguard config was forgotten about. This +leads to unbootable test kernels, causing CI fails. Add +CONFIG_NONPORTABLE=y to the wireguard test suite configuration for +riscv32. + +Fixes: 44c1e84a38a0 ("RISC-V: Add CONFIG_{NON,}PORTABLE") +Signed-off-by: Jason A. Donenfeld +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220809145757.83673-1-Jason@zx2c4.com +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/selftests/wireguard/qemu/arch/riscv32.config | 1 + + 1 file changed, 1 insertion(+) + +--- a/tools/testing/selftests/wireguard/qemu/arch/riscv32.config ++++ b/tools/testing/selftests/wireguard/qemu/arch/riscv32.config +@@ -1,3 +1,4 @@ ++CONFIG_NONPORTABLE=y + CONFIG_ARCH_RV32I=y + CONFIG_MMU=y + CONFIG_FPU=y