diff --git a/Patchlist.changelog b/Patchlist.changelog index 5ca1aa0..979f838 100644 --- a/Patchlist.changelog +++ b/Patchlist.changelog @@ -1,3 +1,9 @@ +"https://gitlab.com/cki-project/kernel-ark/-/commit"/10744450395503f1c584313b322f52e8f8542ef0 + 10744450395503f1c584313b322f52e8f8542ef0 ALSA: memalloc: Add fallback SG-buffer allocations for x86 + +"https://gitlab.com/cki-project/kernel-ark/-/commit"/46b6019e2cd4f3b778dc92eccee8facaf5b66be1 + 46b6019e2cd4f3b778dc92eccee8facaf5b66be1 drm/i915: update new TMDS clock setting defined by VBT + "https://gitlab.com/cki-project/kernel-ark/-/commit"/1324e08de44f4f42845c6c3d3c46bfac8edb5f9e 1324e08de44f4f42845c6c3d3c46bfac8edb5f9e Move the patch to the redhat directory so it doesn't end up as an applied patch diff --git a/kernel-x86_64-debug-fedora.config b/kernel-x86_64-debug-fedora.config index 0d2e410..a65c0ef 100644 --- a/kernel-x86_64-debug-fedora.config +++ b/kernel-x86_64-debug-fedora.config @@ -7759,7 +7759,7 @@ CONFIG_X86_ACPI_CPUFREQ_CPB=y CONFIG_X86_ACPI_CPUFREQ=m CONFIG_X86_AMD_FREQ_SENSITIVITY=m CONFIG_X86_AMD_PLATFORM_DEVICE=y -CONFIG_X86_AMD_PSTATE=y +CONFIG_X86_AMD_PSTATE=m # CONFIG_X86_ANDROID_TABLETS is not set CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y CONFIG_X86_CHECK_BIOS_CORRUPTION=y diff --git a/kernel-x86_64-debug-rhel.config b/kernel-x86_64-debug-rhel.config index 5cb2ee9..0c274d1 100644 --- a/kernel-x86_64-debug-rhel.config +++ b/kernel-x86_64-debug-rhel.config @@ -6754,7 +6754,7 @@ CONFIG_X86_ACPI_CPUFREQ_CPB=y CONFIG_X86_ACPI_CPUFREQ=m CONFIG_X86_AMD_FREQ_SENSITIVITY=m CONFIG_X86_AMD_PLATFORM_DEVICE=y -CONFIG_X86_AMD_PSTATE=y +CONFIG_X86_AMD_PSTATE=m CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y CONFIG_X86_CHECK_BIOS_CORRUPTION=y CONFIG_X86_CMPXCHG64=y diff --git a/kernel-x86_64-fedora.config b/kernel-x86_64-fedora.config index d7885b5..359377f 100644 --- a/kernel-x86_64-fedora.config +++ b/kernel-x86_64-fedora.config @@ -7733,7 +7733,7 @@ CONFIG_X86_ACPI_CPUFREQ_CPB=y CONFIG_X86_ACPI_CPUFREQ=m CONFIG_X86_AMD_FREQ_SENSITIVITY=m CONFIG_X86_AMD_PLATFORM_DEVICE=y -CONFIG_X86_AMD_PSTATE=y +CONFIG_X86_AMD_PSTATE=m # CONFIG_X86_ANDROID_TABLETS is not set # CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK is not set CONFIG_X86_CHECK_BIOS_CORRUPTION=y diff --git a/kernel-x86_64-rhel.config b/kernel-x86_64-rhel.config index b1abdf6..d306f39 100644 --- a/kernel-x86_64-rhel.config +++ b/kernel-x86_64-rhel.config @@ -6730,7 +6730,7 @@ CONFIG_X86_ACPI_CPUFREQ_CPB=y CONFIG_X86_ACPI_CPUFREQ=m CONFIG_X86_AMD_FREQ_SENSITIVITY=m CONFIG_X86_AMD_PLATFORM_DEVICE=y -CONFIG_X86_AMD_PSTATE=y +CONFIG_X86_AMD_PSTATE=m # CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK is not set CONFIG_X86_CHECK_BIOS_CORRUPTION=y CONFIG_X86_CMPXCHG64=y diff --git a/kernel.spec b/kernel.spec index 16261fd..9f7b464 100755 --- a/kernel.spec +++ b/kernel.spec @@ -130,7 +130,7 @@ Summary: The Linux kernel # The kernel tarball/base version %define kversion 5.17 -%define rpmversion 5.17.2 +%define rpmversion 5.17.3 %define patchversion 5.17 %define pkgrelease 300 @@ -695,7 +695,7 @@ BuildRequires: lld # exact git commit you can run # # xzcat -qq ${TARBALL} | git get-tar-commit-id -Source0: linux-5.17.2.tar.xz +Source0: linux-5.17.3.tar.xz Source1: Makefile.rhelver @@ -1387,8 +1387,8 @@ ApplyOptionalPatch() fi } -%setup -q -n kernel-5.17.2 -c -mv linux-5.17.2 linux-%{KVERREL} +%setup -q -n kernel-5.17.3 -c +mv linux-5.17.3 linux-%{KVERREL} cd linux-%{KVERREL} cp -a %{SOURCE1} . @@ -3015,6 +3015,11 @@ fi # # %changelog +* Wed Apr 13 2022 Justin M. Forbes [5.17.3-0] +- ALSA: memalloc: Add fallback SG-buffer allocations for x86 (Takashi Iwai) +- Turn AMD_PSTATE back to module so users can choose (Justin M. Forbes) +- drm/i915: update new TMDS clock setting defined by VBT (Lee Shawn C) + * Fri Apr 08 2022 Justin M. Forbes [5.17.2-0] - Move the patch to the redhat directory so it doesn't end up as an applied patch (Justin M. Forbes) - Config updates for 5.17.2 (Justin M. Forbes) diff --git a/patch-5.17-redhat.patch b/patch-5.17-redhat.patch index 05acb8d..81145cc 100644 --- a/patch-5.17-redhat.patch +++ b/patch-5.17-redhat.patch @@ -19,7 +19,9 @@ drivers/firmware/efi/Makefile | 1 + drivers/firmware/efi/efi.c | 124 +++++++++++++++------ drivers/firmware/efi/secureboot.c | 38 +++++++ + drivers/gpu/drm/i915/display/intel_bios.c | 6 + drivers/gpu/drm/i915/display/intel_psr.c | 9 ++ + drivers/gpu/drm/i915/display/intel_vbt_defs.h | 3 + drivers/hid/hid-rmi.c | 64 ----------- drivers/hwtracing/coresight/coresight-etm4x-core.c | 19 ++++ drivers/input/rmi4/rmi_driver.c | 124 ++++++++++++--------- @@ -36,12 +38,12 @@ include/linux/efi.h | 22 ++-- include/linux/lsm_hook_defs.h | 2 + include/linux/lsm_hooks.h | 6 + - include/linux/mmzone.h | 11 +- include/linux/module.h | 1 + include/linux/nfs_fs_sb.h | 1 + include/linux/random.h | 7 ++ include/linux/rmi.h | 1 + include/linux/security.h | 5 + + include/sound/memalloc.h | 5 + init/Kconfig | 2 +- kernel/dma/swiotlb.c | 12 +- kernel/module.c | 2 + @@ -53,7 +55,8 @@ security/lockdown/Kconfig | 13 +++ security/lockdown/lockdown.c | 1 + security/security.c | 6 + - 55 files changed, 767 insertions(+), 211 deletions(-) + sound/core/memalloc.c | 111 +++++++++++++++++- + 58 files changed, 884 insertions(+), 208 deletions(-) diff --git a/Documentation/core-api/dma-attributes.rst b/Documentation/core-api/dma-attributes.rst index 1887d92e8e92..17706dc91ec9 100644 @@ -105,7 +108,7 @@ index 000000000000..733a26bd887a + +endmenu diff --git a/Makefile b/Makefile -index 06d852cad74f..408d95c9769e 100644 +index 02fbef1a0213..7e08c751f348 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,10 @@ $(if $(filter __%, $(MAKECMDGOALS)), \ @@ -918,6 +921,23 @@ index 000000000000..de0a3714a5d4 + } + } +} +diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c +index 9d989c9f5da4..5d97a251d3dc 100644 +--- a/drivers/gpu/drm/i915/display/intel_bios.c ++++ b/drivers/gpu/drm/i915/display/intel_bios.c +@@ -1968,6 +1968,12 @@ static int _intel_bios_max_tmds_clock(const struct intel_bios_encoder_data *devd + fallthrough; + case HDMI_MAX_DATA_RATE_PLATFORM: + return 0; ++ case HDMI_MAX_DATA_RATE_594: ++ return 594000; ++ case HDMI_MAX_DATA_RATE_340: ++ return 340000; ++ case HDMI_MAX_DATA_RATE_300: ++ return 300000; + case HDMI_MAX_DATA_RATE_297: + return 297000; + case HDMI_MAX_DATA_RATE_165: diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index b00de57cc957..c613b531b281 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c @@ -938,6 +958,20 @@ index b00de57cc957..c613b531b281 100644 return crtc_state->enable_psr2_sel_fetch = true; } +diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h b/drivers/gpu/drm/i915/display/intel_vbt_defs.h +index f043d85ba64d..e8f99ba4e772 100644 +--- a/drivers/gpu/drm/i915/display/intel_vbt_defs.h ++++ b/drivers/gpu/drm/i915/display/intel_vbt_defs.h +@@ -307,6 +307,9 @@ struct bdb_general_features { + #define HDMI_MAX_DATA_RATE_PLATFORM 0 /* 204 */ + #define HDMI_MAX_DATA_RATE_297 1 /* 204 */ + #define HDMI_MAX_DATA_RATE_165 2 /* 204 */ ++#define HDMI_MAX_DATA_RATE_594 3 /* 249 */ ++#define HDMI_MAX_DATA_RATE_340 4 /* 249 */ ++#define HDMI_MAX_DATA_RATE_300 5 /* 249 */ + + #define LEGACY_CHILD_DEVICE_CONFIG_SIZE 33 + diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c index 311eee599ce9..2460c6bd46f8 100644 --- a/drivers/hid/hid-rmi.c @@ -1704,31 +1738,6 @@ index 419b5febc3ca..491323dfe4e0 100644 * Security hooks for perf events * * @perf_event_open: -diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h -index aed44e9b5d89..c7a0d500b396 100644 ---- a/include/linux/mmzone.h -+++ b/include/linux/mmzone.h -@@ -1389,13 +1389,16 @@ static inline unsigned long *section_to_usemap(struct mem_section *ms) - - static inline struct mem_section *__nr_to_section(unsigned long nr) - { -+ unsigned long root = SECTION_NR_TO_ROOT(nr); -+ -+ if (unlikely(root >= NR_SECTION_ROOTS)) -+ return NULL; -+ - #ifdef CONFIG_SPARSEMEM_EXTREME -- if (!mem_section) -+ if (!mem_section || !mem_section[root]) - return NULL; - #endif -- if (!mem_section[SECTION_NR_TO_ROOT(nr)]) -- return NULL; -- return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; -+ return &mem_section[root][nr & SECTION_ROOT_MASK]; - } - extern size_t mem_section_usage_size(void); - diff --git a/include/linux/module.h b/include/linux/module.h index 1e135fd5c076..6ec4d001c1e2 100644 --- a/include/linux/module.h @@ -1813,6 +1822,22 @@ index 25b3ef71f495..d37a6c88c69f 100644 #endif /* CONFIG_SECURITY */ #if defined(CONFIG_SECURITY) && defined(CONFIG_WATCH_QUEUE) +diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h +index 653dfffb3ac8..8d79cebf95f3 100644 +--- a/include/sound/memalloc.h ++++ b/include/sound/memalloc.h +@@ -51,6 +51,11 @@ struct snd_dma_device { + #define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV /* no SG-buf support */ + #define SNDRV_DMA_TYPE_DEV_WC_SG SNDRV_DMA_TYPE_DEV_WC + #endif ++/* fallback types, don't use those directly */ ++#ifdef CONFIG_SND_DMA_SGBUF ++#define SNDRV_DMA_TYPE_DEV_SG_FALLBACK 10 ++#define SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK 11 ++#endif + + /* + * info for buffer allocation diff --git a/init/Kconfig b/init/Kconfig index e9119bf54b1f..e3b57b4898fe 100644 --- a/init/Kconfig @@ -2028,3 +2053,154 @@ index b7cf5cbfdc67..3cde9062fcf6 100644 #ifdef CONFIG_PERF_EVENTS int security_perf_event_open(struct perf_event_attr *attr, int type) { +diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c +index 6fd763d4d15b..15dc7160ba34 100644 +--- a/sound/core/memalloc.c ++++ b/sound/core/memalloc.c +@@ -499,6 +499,10 @@ static const struct snd_malloc_ops snd_dma_wc_ops = { + }; + #endif /* CONFIG_X86 */ + ++#ifdef CONFIG_SND_DMA_SGBUF ++static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size); ++#endif ++ + /* + * Non-contiguous pages allocator + */ +@@ -509,8 +513,18 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size) + + sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir, + DEFAULT_GFP, 0); +- if (!sgt) ++ if (!sgt) { ++#ifdef CONFIG_SND_DMA_SGBUF ++ if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG) ++ dmab->dev.type = SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK; ++ else ++ dmab->dev.type = SNDRV_DMA_TYPE_DEV_SG_FALLBACK; ++ return snd_dma_sg_fallback_alloc(dmab, size); ++#else + return NULL; ++#endif ++ } ++ + dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, + sg_dma_address(sgt->sgl)); + p = dma_vmap_noncontiguous(dmab->dev.dev, size, sgt); +@@ -633,6 +647,8 @@ static void *snd_dma_sg_wc_alloc(struct snd_dma_buffer *dmab, size_t size) + + if (!p) + return NULL; ++ if (dmab->dev.type != SNDRV_DMA_TYPE_DEV_WC_SG) ++ return p; + for_each_sgtable_page(sgt, &iter, 0) + set_memory_wc(sg_wc_address(&iter), 1); + return p; +@@ -665,6 +681,95 @@ static const struct snd_malloc_ops snd_dma_sg_wc_ops = { + .get_page = snd_dma_noncontig_get_page, + .get_chunk_size = snd_dma_noncontig_get_chunk_size, + }; ++ ++/* Fallback SG-buffer allocations for x86 */ ++struct snd_dma_sg_fallback { ++ size_t count; ++ struct page **pages; ++ dma_addr_t *addrs; ++}; ++ ++static void __snd_dma_sg_fallback_free(struct snd_dma_buffer *dmab, ++ struct snd_dma_sg_fallback *sgbuf) ++{ ++ size_t i; ++ ++ if (sgbuf->count && dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK) ++ set_pages_array_wb(sgbuf->pages, sgbuf->count); ++ for (i = 0; i < sgbuf->count && sgbuf->pages[i]; i++) ++ dma_free_coherent(dmab->dev.dev, PAGE_SIZE, ++ page_address(sgbuf->pages[i]), ++ sgbuf->addrs[i]); ++ kvfree(sgbuf->pages); ++ kvfree(sgbuf->addrs); ++ kfree(sgbuf); ++} ++ ++static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size) ++{ ++ struct snd_dma_sg_fallback *sgbuf; ++ struct page **pages; ++ size_t i, count; ++ void *p; ++ ++ sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL); ++ if (!sgbuf) ++ return NULL; ++ count = PAGE_ALIGN(size) >> PAGE_SHIFT; ++ pages = kvcalloc(count, sizeof(*pages), GFP_KERNEL); ++ if (!pages) ++ goto error; ++ sgbuf->pages = pages; ++ sgbuf->addrs = kvcalloc(count, sizeof(*sgbuf->addrs), GFP_KERNEL); ++ if (!sgbuf->addrs) ++ goto error; ++ ++ for (i = 0; i < count; sgbuf->count++, i++) { ++ p = dma_alloc_coherent(dmab->dev.dev, PAGE_SIZE, ++ &sgbuf->addrs[i], DEFAULT_GFP); ++ if (!p) ++ goto error; ++ sgbuf->pages[i] = virt_to_page(p); ++ } ++ ++ if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK) ++ set_pages_array_wc(pages, count); ++ p = vmap(pages, count, VM_MAP, PAGE_KERNEL); ++ if (!p) ++ goto error; ++ dmab->private_data = sgbuf; ++ return p; ++ ++ error: ++ __snd_dma_sg_fallback_free(dmab, sgbuf); ++ return NULL; ++} ++ ++static void snd_dma_sg_fallback_free(struct snd_dma_buffer *dmab) ++{ ++ vunmap(dmab->area); ++ __snd_dma_sg_fallback_free(dmab, dmab->private_data); ++} ++ ++static int snd_dma_sg_fallback_mmap(struct snd_dma_buffer *dmab, ++ struct vm_area_struct *area) ++{ ++ struct snd_dma_sg_fallback *sgbuf = dmab->private_data; ++ ++ if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK) ++ area->vm_page_prot = pgprot_writecombine(area->vm_page_prot); ++ return vm_map_pages(area, sgbuf->pages, sgbuf->count); ++} ++ ++static const struct snd_malloc_ops snd_dma_sg_fallback_ops = { ++ .alloc = snd_dma_sg_fallback_alloc, ++ .free = snd_dma_sg_fallback_free, ++ .mmap = snd_dma_sg_fallback_mmap, ++ /* reuse vmalloc helpers */ ++ .get_addr = snd_dma_vmalloc_get_addr, ++ .get_page = snd_dma_vmalloc_get_page, ++ .get_chunk_size = snd_dma_vmalloc_get_chunk_size, ++}; + #endif /* CONFIG_SND_DMA_SGBUF */ + + /* +@@ -736,6 +841,10 @@ static const struct snd_malloc_ops *dma_ops[] = { + #ifdef CONFIG_GENERIC_ALLOCATOR + [SNDRV_DMA_TYPE_DEV_IRAM] = &snd_dma_iram_ops, + #endif /* CONFIG_GENERIC_ALLOCATOR */ ++#ifdef CONFIG_SND_DMA_SGBUF ++ [SNDRV_DMA_TYPE_DEV_SG_FALLBACK] = &snd_dma_sg_fallback_ops, ++ [SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK] = &snd_dma_sg_fallback_ops, ++#endif + #endif /* CONFIG_HAS_DMA */ + }; + diff --git a/sources b/sources index 848e94c..a913d5d 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (linux-5.17.2.tar.xz) = 6082931fbad82ad689f6efb0345fa6743fd0e2199965b6cb9b8f64c64458bcd4c853d4952fd0b35ea52df42791ce13bd3d970ed76279b8509a149d475bd77c94 -SHA512 (kernel-abi-stablelists-5.17.2-300.tar.bz2) = 7c94adc63e4a838e5f4214f0871605953a85ba707e6cfa83666701a86d5cc95209ba847f9a4ab6db9b5dd23c30162345c4bf16b34ae7caa9803469ecd2824fd8 -SHA512 (kernel-kabi-dw-5.17.2-300.tar.bz2) = 1ee74cb8c09ab23e3792466d447393bd7ce3228cea57cb0559f3bc83cf73f4b8c9ee070a0894b1cac0efe7481a8edc9b8d9c738c61956f73e1c2e0cee60e55b7 +SHA512 (linux-5.17.3.tar.xz) = 94cf35f451ee0d17a36f4d45e99a284e13951f70449f69789b453fc3a053a474519fca3bed0ee84da203b1a9baabb26e7e663034c355f2293fc7704b9b95b23d +SHA512 (kernel-abi-stablelists-5.17.3-300.tar.bz2) = f5bc8311ed0efa5962f34d6ce6dd4b69b56bdcc85e8a4442ff4483946f0ce6f770d1949ae38d355a23ef334f99cf2d6b42c778e024a15ed29a229b416238f6c0 +SHA512 (kernel-kabi-dw-5.17.3-300.tar.bz2) = 9ec0f3d1aea18ec8f6e248d52a64500fce1de5f72e949ae642dd3e80e47a483dcbb399a60b40b871eced9bd1e1985d54e542b8b3f91469cd3b5e02205694bb0c