From: Greg Kroah-Hartman Date: Wed, 4 Jan 2023 13:15:58 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v6.1.4~67 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ad1c96ea4d6b4778c2f26d7a1c51e2383765c83;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: arm-ux500-do-not-directly-dereference-__iomem.patch arm64-dts-qcom-sdm845-db845c-correct-spi2-pins-drive-strength.patch arm64-dts-qcom-sdm850-lenovo-yoga-c630-correct-i2c12-pins-drive-strength.patch btrfs-fix-resolving-backrefs-for-inline-extent-followed-by-prealloc.patch cpufreq-init-completion-before-kobject_init_and_add.patch jbd2-use-the-correct-print-format.patch kest.pl-fix-grub2-menu-handling-for-rebooting.patch ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch media-stv0288-use-explicitly-signed-char.patch mmc-sdhci-sprd-disable-clk_auto-when-the-clock-is-less-than-400k.patch perf-x86-intel-uncore-clear-attr_update-properly.patch perf-x86-intel-uncore-disable-i-o-stacks-to-pmu-mapping-on-icx-d.patch pm-devfreq-governor-add-a-private-governor_data-for-governor.patch selftests-use-optional-usercflags-and-userldflags.patch soc-qcom-select-remap_mmio-for-llcc-driver.patch --- diff --git a/queue-5.15/arm-ux500-do-not-directly-dereference-__iomem.patch b/queue-5.15/arm-ux500-do-not-directly-dereference-__iomem.patch new file mode 100644 index 00000000000..3121d51185b --- /dev/null +++ b/queue-5.15/arm-ux500-do-not-directly-dereference-__iomem.patch @@ -0,0 +1,54 @@ +From 65b0e307a1a9193571db12910f382f84195a3d29 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Tue, 8 Nov 2022 13:37:55 +0100 +Subject: ARM: ux500: do not directly dereference __iomem + +From: Jason A. Donenfeld + +commit 65b0e307a1a9193571db12910f382f84195a3d29 upstream. + +Sparse reports that calling add_device_randomness() on `uid` is a +violation of address spaces. And indeed the next usage uses readl() +properly, but that was left out when passing it toadd_device_ +randomness(). So instead copy the whole thing to the stack first. + +Fixes: 4040d10a3d44 ("ARM: ux500: add DB serial number to entropy pool") +Cc: Linus Walleij +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/all/202210230819.loF90KDh-lkp@intel.com/ +Reported-by: kernel test robot +Signed-off-by: Jason A. Donenfeld +Link: https://lore.kernel.org/r/20221108123755.207438-1-Jason@zx2c4.com +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman +--- + drivers/soc/ux500/ux500-soc-id.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +--- a/drivers/soc/ux500/ux500-soc-id.c ++++ b/drivers/soc/ux500/ux500-soc-id.c +@@ -167,20 +167,18 @@ ATTRIBUTE_GROUPS(ux500_soc); + static const char *db8500_read_soc_id(struct device_node *backupram) + { + void __iomem *base; +- void __iomem *uid; + const char *retstr; ++ u32 uid[5]; + + base = of_iomap(backupram, 0); + if (!base) + return NULL; +- uid = base + 0x1fc0; ++ memcpy_fromio(uid, base + 0x1fc0, sizeof(uid)); + + /* Throw these device-specific numbers into the entropy pool */ +- add_device_randomness(uid, 0x14); ++ add_device_randomness(uid, sizeof(uid)); + retstr = kasprintf(GFP_KERNEL, "%08x%08x%08x%08x%08x", +- readl((u32 *)uid+0), +- readl((u32 *)uid+1), readl((u32 *)uid+2), +- readl((u32 *)uid+3), readl((u32 *)uid+4)); ++ uid[0], uid[1], uid[2], uid[3], uid[4]); + iounmap(base); + return retstr; + } diff --git a/queue-5.15/arm64-dts-qcom-sdm845-db845c-correct-spi2-pins-drive-strength.patch b/queue-5.15/arm64-dts-qcom-sdm845-db845c-correct-spi2-pins-drive-strength.patch new file mode 100644 index 00000000000..5afdfdc2edf --- /dev/null +++ b/queue-5.15/arm64-dts-qcom-sdm845-db845c-correct-spi2-pins-drive-strength.patch @@ -0,0 +1,44 @@ +From 9905370560d9c29adc15f4937c5a0c0dac05f0b4 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Mon, 10 Oct 2022 07:44:13 -0400 +Subject: arm64: dts: qcom: sdm845-db845c: correct SPI2 pins drive strength + +From: Krzysztof Kozlowski + +commit 9905370560d9c29adc15f4937c5a0c0dac05f0b4 upstream. + +The pin configuration (done with generic pin controller helpers and +as expressed by bindings) requires children nodes with either: +1. "pins" property and the actual configuration, +2. another set of nodes with above point. + +The qup_spi2_default pin configuration uses alreaady the second method +with a "pinmux" child, so configure drive-strength similarly in +"pinconf". Otherwise the PIN drive strength would not be applied. + +Fixes: 8d23a0040475 ("arm64: dts: qcom: db845c: add Low speed expansion i2c and spi nodes") +Cc: +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Douglas Anderson +Reviewed-by: Neil Armstrong +Signed-off-by: Bjorn Andersson +Link: https://lore.kernel.org/r/20221010114417.29859-2-krzysztof.kozlowski@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts ++++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts +@@ -1045,7 +1045,10 @@ + + /* PINCTRL - additions to nodes defined in sdm845.dtsi */ + &qup_spi2_default { +- drive-strength = <16>; ++ pinconf { ++ pins = "gpio27", "gpio28", "gpio29", "gpio30"; ++ drive-strength = <16>; ++ }; + }; + + &qup_uart3_default{ diff --git a/queue-5.15/arm64-dts-qcom-sdm850-lenovo-yoga-c630-correct-i2c12-pins-drive-strength.patch b/queue-5.15/arm64-dts-qcom-sdm850-lenovo-yoga-c630-correct-i2c12-pins-drive-strength.patch new file mode 100644 index 00000000000..13f2537c698 --- /dev/null +++ b/queue-5.15/arm64-dts-qcom-sdm850-lenovo-yoga-c630-correct-i2c12-pins-drive-strength.patch @@ -0,0 +1,44 @@ +From fd49776d8f458bba5499384131eddc0b8bcaf50c Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Fri, 30 Sep 2022 21:20:37 +0200 +Subject: arm64: dts: qcom: sdm850-lenovo-yoga-c630: correct I2C12 pins drive strength + +From: Krzysztof Kozlowski + +commit fd49776d8f458bba5499384131eddc0b8bcaf50c upstream. + +The pin configuration (done with generic pin controller helpers and +as expressed by bindings) requires children nodes with either: +1. "pins" property and the actual configuration, +2. another set of nodes with above point. + +The qup_i2c12_default pin configuration used second method - with a +"pinmux" child. + +Fixes: 44acee207844 ("arm64: dts: qcom: Add Lenovo Yoga C630") +Cc: +Signed-off-by: Krzysztof Kozlowski +Tested-by: Steev Klimaszewski +Reviewed-by: Konrad Dybcio +Signed-off-by: Bjorn Andersson +Link: https://lore.kernel.org/r/20220930192039.240486-1-krzysztof.kozlowski@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts ++++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts +@@ -475,8 +475,10 @@ + }; + + &qup_i2c12_default { +- drive-strength = <2>; +- bias-disable; ++ pinmux { ++ drive-strength = <2>; ++ bias-disable; ++ }; + }; + + &qup_uart6_default { diff --git a/queue-5.15/btrfs-fix-resolving-backrefs-for-inline-extent-followed-by-prealloc.patch b/queue-5.15/btrfs-fix-resolving-backrefs-for-inline-extent-followed-by-prealloc.patch new file mode 100644 index 00000000000..e9d753f0ff1 --- /dev/null +++ b/queue-5.15/btrfs-fix-resolving-backrefs-for-inline-extent-followed-by-prealloc.patch @@ -0,0 +1,91 @@ +From 560840afc3e63bbe5d9c5ef6b2ecf8f3589adff6 Mon Sep 17 00:00:00 2001 +From: Boris Burkov +Date: Wed, 14 Dec 2022 15:05:08 -0800 +Subject: btrfs: fix resolving backrefs for inline extent followed by prealloc + +From: Boris Burkov + +commit 560840afc3e63bbe5d9c5ef6b2ecf8f3589adff6 upstream. + +If a file consists of an inline extent followed by a regular or prealloc +extent, then a legitimate attempt to resolve a logical address in the +non-inline region will result in add_all_parents reading the invalid +offset field of the inline extent. If the inline extent item is placed +in the leaf eb s.t. it is the first item, attempting to access the +offset field will not only be meaningless, it will go past the end of +the eb and cause this panic: + + [17.626048] BTRFS warning (device dm-2): bad eb member end: ptr 0x3fd4 start 30834688 member offset 16377 size 8 + [17.631693] general protection fault, probably for non-canonical address 0x5088000000000: 0000 [#1] SMP PTI + [17.635041] CPU: 2 PID: 1267 Comm: btrfs Not tainted 5.12.0-07246-g75175d5adc74-dirty #199 + [17.637969] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 + [17.641995] RIP: 0010:btrfs_get_64+0xe7/0x110 + [17.649890] RSP: 0018:ffffc90001f73a08 EFLAGS: 00010202 + [17.651652] RAX: 0000000000000001 RBX: ffff88810c42d000 RCX: 0000000000000000 + [17.653921] RDX: 0005088000000000 RSI: ffffc90001f73a0f RDI: 0000000000000001 + [17.656174] RBP: 0000000000000ff9 R08: 0000000000000007 R09: c0000000fffeffff + [17.658441] R10: ffffc90001f73790 R11: ffffc90001f73788 R12: ffff888106afe918 + [17.661070] R13: 0000000000003fd4 R14: 0000000000003f6f R15: cdcdcdcdcdcdcdcd + [17.663617] FS: 00007f64e7627d80(0000) GS:ffff888237c80000(0000) knlGS:0000000000000000 + [17.666525] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + [17.668664] CR2: 000055d4a39152e8 CR3: 000000010c596002 CR4: 0000000000770ee0 + [17.671253] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 + [17.673634] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 + [17.676034] PKRU: 55555554 + [17.677004] Call Trace: + [17.677877] add_all_parents+0x276/0x480 + [17.679325] find_parent_nodes+0xfae/0x1590 + [17.680771] btrfs_find_all_leafs+0x5e/0xa0 + [17.682217] iterate_extent_inodes+0xce/0x260 + [17.683809] ? btrfs_inode_flags_to_xflags+0x50/0x50 + [17.685597] ? iterate_inodes_from_logical+0xa1/0xd0 + [17.687404] iterate_inodes_from_logical+0xa1/0xd0 + [17.689121] ? btrfs_inode_flags_to_xflags+0x50/0x50 + [17.691010] btrfs_ioctl_logical_to_ino+0x131/0x190 + [17.692946] btrfs_ioctl+0x104a/0x2f60 + [17.694384] ? selinux_file_ioctl+0x182/0x220 + [17.695995] ? __x64_sys_ioctl+0x84/0xc0 + [17.697394] __x64_sys_ioctl+0x84/0xc0 + [17.698697] do_syscall_64+0x33/0x40 + [17.700017] entry_SYSCALL_64_after_hwframe+0x44/0xae + [17.701753] RIP: 0033:0x7f64e72761b7 + [17.709355] RSP: 002b:00007ffefb067f58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 + [17.712088] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f64e72761b7 + [17.714667] RDX: 00007ffefb067fb0 RSI: 00000000c0389424 RDI: 0000000000000003 + [17.717386] RBP: 00007ffefb06d188 R08: 000055d4a390d2b0 R09: 00007f64e7340a60 + [17.719938] R10: 0000000000000231 R11: 0000000000000246 R12: 0000000000000001 + [17.722383] R13: 0000000000000000 R14: 00000000c0389424 R15: 000055d4a38fd2a0 + [17.724839] Modules linked in: + +Fix the bug by detecting the inline extent item in add_all_parents and +skipping to the next extent item. + +CC: stable@vger.kernel.org # 4.9+ +Reviewed-by: Qu Wenruo +Signed-off-by: Boris Burkov +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/backref.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/fs/btrfs/backref.c ++++ b/fs/btrfs/backref.c +@@ -433,6 +433,7 @@ static int add_all_parents(struct btrfs_ + u64 wanted_disk_byte = ref->wanted_disk_byte; + u64 count = 0; + u64 data_offset; ++ u8 type; + + if (level != 0) { + eb = path->nodes[level]; +@@ -487,6 +488,9 @@ static int add_all_parents(struct btrfs_ + continue; + } + fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item); ++ type = btrfs_file_extent_type(eb, fi); ++ if (type == BTRFS_FILE_EXTENT_INLINE) ++ goto next; + disk_byte = btrfs_file_extent_disk_bytenr(eb, fi); + data_offset = btrfs_file_extent_offset(eb, fi); + diff --git a/queue-5.15/cpufreq-init-completion-before-kobject_init_and_add.patch b/queue-5.15/cpufreq-init-completion-before-kobject_init_and_add.patch new file mode 100644 index 00000000000..cc1a626da7c --- /dev/null +++ b/queue-5.15/cpufreq-init-completion-before-kobject_init_and_add.patch @@ -0,0 +1,59 @@ +From 5c51054896bcce1d33d39fead2af73fec24f40b6 Mon Sep 17 00:00:00 2001 +From: Yongqiang Liu +Date: Thu, 10 Nov 2022 14:23:07 +0000 +Subject: cpufreq: Init completion before kobject_init_and_add() + +From: Yongqiang Liu + +commit 5c51054896bcce1d33d39fead2af73fec24f40b6 upstream. + +In cpufreq_policy_alloc(), it will call uninitialed completion in +cpufreq_sysfs_release() when kobject_init_and_add() fails. And +that will cause a crash such as the following page fault in complete: + +BUG: unable to handle page fault for address: fffffffffffffff8 +[..] +RIP: 0010:complete+0x98/0x1f0 +[..] +Call Trace: + kobject_put+0x1be/0x4c0 + cpufreq_online.cold+0xee/0x1fd + cpufreq_add_dev+0x183/0x1e0 + subsys_interface_register+0x3f5/0x4e0 + cpufreq_register_driver+0x3b7/0x670 + acpi_cpufreq_init+0x56c/0x1000 [acpi_cpufreq] + do_one_initcall+0x13d/0x780 + do_init_module+0x1c3/0x630 + load_module+0x6e67/0x73b0 + __do_sys_finit_module+0x181/0x240 + do_syscall_64+0x35/0x80 + entry_SYSCALL_64_after_hwframe+0x63/0xcd + +Fixes: 4ebe36c94aed ("cpufreq: Fix kobject memleak") +Signed-off-by: Yongqiang Liu +Acked-by: Viresh Kumar +Cc: 5.2+ # 5.2+ +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/cpufreq/cpufreq.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/cpufreq/cpufreq.c ++++ b/drivers/cpufreq/cpufreq.c +@@ -1212,6 +1212,7 @@ static struct cpufreq_policy *cpufreq_po + if (!zalloc_cpumask_var(&policy->real_cpus, GFP_KERNEL)) + goto err_free_rcpumask; + ++ init_completion(&policy->kobj_unregister); + ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, + cpufreq_global_kobject, "policy%u", cpu); + if (ret) { +@@ -1250,7 +1251,6 @@ static struct cpufreq_policy *cpufreq_po + init_rwsem(&policy->rwsem); + spin_lock_init(&policy->transition_lock); + init_waitqueue_head(&policy->transition_wait); +- init_completion(&policy->kobj_unregister); + INIT_WORK(&policy->update, handle_update); + + policy->cpu = cpu; diff --git a/queue-5.15/jbd2-use-the-correct-print-format.patch b/queue-5.15/jbd2-use-the-correct-print-format.patch new file mode 100644 index 00000000000..a48b77882e7 --- /dev/null +++ b/queue-5.15/jbd2-use-the-correct-print-format.patch @@ -0,0 +1,213 @@ +From d87a7b4c77a997d5388566dd511ca8e6b8e8a0a8 Mon Sep 17 00:00:00 2001 +From: Bixuan Cui +Date: Tue, 11 Oct 2022 19:33:44 +0800 +Subject: jbd2: use the correct print format + +From: Bixuan Cui + +commit d87a7b4c77a997d5388566dd511ca8e6b8e8a0a8 upstream. + +The print format error was found when using ftrace event: + <...>-1406 [000] .... 23599442.895823: jbd2_end_commit: dev 252,8 transaction -1866216965 sync 0 head -1866217368 + <...>-1406 [000] .... 23599442.896299: jbd2_start_commit: dev 252,8 transaction -1866216964 sync 0 + +Use the correct print format for transaction, head and tid. + +Fixes: 879c5e6b7cb4 ('jbd2: convert instrumentation from markers to tracepoints') +Signed-off-by: Bixuan Cui +Reviewed-by: Jason Yan +Link: https://lore.kernel.org/r/1665488024-95172-1-git-send-email-cuibixuan@linux.alibaba.com +Signed-off-by: Theodore Ts'o +Cc: stable@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + include/trace/events/jbd2.h | 44 ++++++++++++++++++++++---------------------- + 1 file changed, 22 insertions(+), 22 deletions(-) + +--- a/include/trace/events/jbd2.h ++++ b/include/trace/events/jbd2.h +@@ -40,7 +40,7 @@ DECLARE_EVENT_CLASS(jbd2_commit, + TP_STRUCT__entry( + __field( dev_t, dev ) + __field( char, sync_commit ) +- __field( int, transaction ) ++ __field( tid_t, transaction ) + ), + + TP_fast_assign( +@@ -49,7 +49,7 @@ DECLARE_EVENT_CLASS(jbd2_commit, + __entry->transaction = commit_transaction->t_tid; + ), + +- TP_printk("dev %d,%d transaction %d sync %d", ++ TP_printk("dev %d,%d transaction %u sync %d", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->transaction, __entry->sync_commit) + ); +@@ -97,8 +97,8 @@ TRACE_EVENT(jbd2_end_commit, + TP_STRUCT__entry( + __field( dev_t, dev ) + __field( char, sync_commit ) +- __field( int, transaction ) +- __field( int, head ) ++ __field( tid_t, transaction ) ++ __field( tid_t, head ) + ), + + TP_fast_assign( +@@ -108,7 +108,7 @@ TRACE_EVENT(jbd2_end_commit, + __entry->head = journal->j_tail_sequence; + ), + +- TP_printk("dev %d,%d transaction %d sync %d head %d", ++ TP_printk("dev %d,%d transaction %u sync %d head %u", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->transaction, __entry->sync_commit, __entry->head) + ); +@@ -134,14 +134,14 @@ TRACE_EVENT(jbd2_submit_inode_data, + ); + + DECLARE_EVENT_CLASS(jbd2_handle_start_class, +- TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, ++ TP_PROTO(dev_t dev, tid_t tid, unsigned int type, + unsigned int line_no, int requested_blocks), + + TP_ARGS(dev, tid, type, line_no, requested_blocks), + + TP_STRUCT__entry( + __field( dev_t, dev ) +- __field( unsigned long, tid ) ++ __field( tid_t, tid ) + __field( unsigned int, type ) + __field( unsigned int, line_no ) + __field( int, requested_blocks) +@@ -155,28 +155,28 @@ DECLARE_EVENT_CLASS(jbd2_handle_start_cl + __entry->requested_blocks = requested_blocks; + ), + +- TP_printk("dev %d,%d tid %lu type %u line_no %u " ++ TP_printk("dev %d,%d tid %u type %u line_no %u " + "requested_blocks %d", + MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, + __entry->type, __entry->line_no, __entry->requested_blocks) + ); + + DEFINE_EVENT(jbd2_handle_start_class, jbd2_handle_start, +- TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, ++ TP_PROTO(dev_t dev, tid_t tid, unsigned int type, + unsigned int line_no, int requested_blocks), + + TP_ARGS(dev, tid, type, line_no, requested_blocks) + ); + + DEFINE_EVENT(jbd2_handle_start_class, jbd2_handle_restart, +- TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, ++ TP_PROTO(dev_t dev, tid_t tid, unsigned int type, + unsigned int line_no, int requested_blocks), + + TP_ARGS(dev, tid, type, line_no, requested_blocks) + ); + + TRACE_EVENT(jbd2_handle_extend, +- TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, ++ TP_PROTO(dev_t dev, tid_t tid, unsigned int type, + unsigned int line_no, int buffer_credits, + int requested_blocks), + +@@ -184,7 +184,7 @@ TRACE_EVENT(jbd2_handle_extend, + + TP_STRUCT__entry( + __field( dev_t, dev ) +- __field( unsigned long, tid ) ++ __field( tid_t, tid ) + __field( unsigned int, type ) + __field( unsigned int, line_no ) + __field( int, buffer_credits ) +@@ -200,7 +200,7 @@ TRACE_EVENT(jbd2_handle_extend, + __entry->requested_blocks = requested_blocks; + ), + +- TP_printk("dev %d,%d tid %lu type %u line_no %u " ++ TP_printk("dev %d,%d tid %u type %u line_no %u " + "buffer_credits %d requested_blocks %d", + MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, + __entry->type, __entry->line_no, __entry->buffer_credits, +@@ -208,7 +208,7 @@ TRACE_EVENT(jbd2_handle_extend, + ); + + TRACE_EVENT(jbd2_handle_stats, +- TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, ++ TP_PROTO(dev_t dev, tid_t tid, unsigned int type, + unsigned int line_no, int interval, int sync, + int requested_blocks, int dirtied_blocks), + +@@ -217,7 +217,7 @@ TRACE_EVENT(jbd2_handle_stats, + + TP_STRUCT__entry( + __field( dev_t, dev ) +- __field( unsigned long, tid ) ++ __field( tid_t, tid ) + __field( unsigned int, type ) + __field( unsigned int, line_no ) + __field( int, interval ) +@@ -237,7 +237,7 @@ TRACE_EVENT(jbd2_handle_stats, + __entry->dirtied_blocks = dirtied_blocks; + ), + +- TP_printk("dev %d,%d tid %lu type %u line_no %u interval %d " ++ TP_printk("dev %d,%d tid %u type %u line_no %u interval %d " + "sync %d requested_blocks %d dirtied_blocks %d", + MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, + __entry->type, __entry->line_no, __entry->interval, +@@ -246,14 +246,14 @@ TRACE_EVENT(jbd2_handle_stats, + ); + + TRACE_EVENT(jbd2_run_stats, +- TP_PROTO(dev_t dev, unsigned long tid, ++ TP_PROTO(dev_t dev, tid_t tid, + struct transaction_run_stats_s *stats), + + TP_ARGS(dev, tid, stats), + + TP_STRUCT__entry( + __field( dev_t, dev ) +- __field( unsigned long, tid ) ++ __field( tid_t, tid ) + __field( unsigned long, wait ) + __field( unsigned long, request_delay ) + __field( unsigned long, running ) +@@ -279,7 +279,7 @@ TRACE_EVENT(jbd2_run_stats, + __entry->blocks_logged = stats->rs_blocks_logged; + ), + +- TP_printk("dev %d,%d tid %lu wait %u request_delay %u running %u " ++ TP_printk("dev %d,%d tid %u wait %u request_delay %u running %u " + "locked %u flushing %u logging %u handle_count %u " + "blocks %u blocks_logged %u", + MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, +@@ -294,14 +294,14 @@ TRACE_EVENT(jbd2_run_stats, + ); + + TRACE_EVENT(jbd2_checkpoint_stats, +- TP_PROTO(dev_t dev, unsigned long tid, ++ TP_PROTO(dev_t dev, tid_t tid, + struct transaction_chp_stats_s *stats), + + TP_ARGS(dev, tid, stats), + + TP_STRUCT__entry( + __field( dev_t, dev ) +- __field( unsigned long, tid ) ++ __field( tid_t, tid ) + __field( unsigned long, chp_time ) + __field( __u32, forced_to_close ) + __field( __u32, written ) +@@ -317,7 +317,7 @@ TRACE_EVENT(jbd2_checkpoint_stats, + __entry->dropped = stats->cs_dropped; + ), + +- TP_printk("dev %d,%d tid %lu chp_time %u forced_to_close %u " ++ TP_printk("dev %d,%d tid %u chp_time %u forced_to_close %u " + "written %u dropped %u", + MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, + jiffies_to_msecs(__entry->chp_time), diff --git a/queue-5.15/kest.pl-fix-grub2-menu-handling-for-rebooting.patch b/queue-5.15/kest.pl-fix-grub2-menu-handling-for-rebooting.patch new file mode 100644 index 00000000000..e6807180a12 --- /dev/null +++ b/queue-5.15/kest.pl-fix-grub2-menu-handling-for-rebooting.patch @@ -0,0 +1,123 @@ +From 26df05a8c1420ad3de314fdd407e7fc2058cc7aa Mon Sep 17 00:00:00 2001 +From: Steven Rostedt +Date: Wed, 30 Nov 2022 17:54:34 -0500 +Subject: kest.pl: Fix grub2 menu handling for rebooting + +From: Steven Rostedt + +commit 26df05a8c1420ad3de314fdd407e7fc2058cc7aa upstream. + +grub2 has submenus where to use grub-reboot, it requires: + + grub-reboot X>Y + +where X is the main index and Y is the submenu. Thus if you have: + +menuentry 'Debian GNU/Linux' --class debian --class gnu-linux ... + [...] +} +submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option ... + menuentry 'Debian GNU/Linux, with Linux 6.0.0-4-amd64' --class debian --class gnu-linux ... + [...] + } + menuentry 'Debian GNU/Linux, with Linux 6.0.0-4-amd64 (recovery mode)' --class debian --class gnu-linux ... + [...] + } + menuentry 'Debian GNU/Linux, with Linux test' --class debian --class gnu-linux ... + [...] + } + +And wanted to boot to the "Linux test" kernel, you need to run: + + # grub-reboot 1>2 + +As 1 is the second top menu (the submenu) and 2 is the third of the sub +menu entries. + +Have the grub.cfg parsing for grub2 handle such cases. + +Cc: stable@vger.kernel.org +Fixes: a15ba91361d46 ("ktest: Add support for grub2") +Reviewed-by: John 'Warthog9' Hawley (VMware) +Signed-off-by: Steven Rostedt +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/ktest/ktest.pl | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +--- a/tools/testing/ktest/ktest.pl ++++ b/tools/testing/ktest/ktest.pl +@@ -1963,7 +1963,7 @@ sub run_scp_mod { + + sub _get_grub_index { + +- my ($command, $target, $skip) = @_; ++ my ($command, $target, $skip, $submenu) = @_; + + return if (defined($grub_number) && defined($last_grub_menu) && + $last_grub_menu eq $grub_menu && defined($last_machine) && +@@ -1980,11 +1980,16 @@ sub _get_grub_index { + + my $found = 0; + ++ my $submenu_number = 0; ++ + while () { + if (/$target/) { + $grub_number++; + $found = 1; + last; ++ } elsif (defined($submenu) && /$submenu/) { ++ $submenu_number++; ++ $grub_number = -1; + } elsif (/$skip/) { + $grub_number++; + } +@@ -1993,6 +1998,9 @@ sub _get_grub_index { + + dodie "Could not find '$grub_menu' through $command on $machine" + if (!$found); ++ if ($submenu_number > 0) { ++ $grub_number = "$submenu_number>$grub_number"; ++ } + doprint "$grub_number\n"; + $last_grub_menu = $grub_menu; + $last_machine = $machine; +@@ -2003,6 +2011,7 @@ sub get_grub_index { + my $command; + my $target; + my $skip; ++ my $submenu; + my $grub_menu_qt; + + if ($reboot_type !~ /^grub/) { +@@ -2017,8 +2026,9 @@ sub get_grub_index { + $skip = '^\s*title\s'; + } elsif ($reboot_type eq "grub2") { + $command = "cat $grub_file"; +- $target = '^menuentry.*' . $grub_menu_qt; +- $skip = '^menuentry\s|^submenu\s'; ++ $target = '^\s*menuentry.*' . $grub_menu_qt; ++ $skip = '^\s*menuentry'; ++ $submenu = '^\s*submenu\s'; + } elsif ($reboot_type eq "grub2bls") { + $command = $grub_bls_get; + $target = '^title=.*' . $grub_menu_qt; +@@ -2027,7 +2037,7 @@ sub get_grub_index { + return; + } + +- _get_grub_index($command, $target, $skip); ++ _get_grub_index($command, $target, $skip, $submenu); + } + + sub wait_for_input { +@@ -2090,7 +2100,7 @@ sub reboot_to { + if ($reboot_type eq "grub") { + run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch)'"; + } elsif (($reboot_type eq "grub2") or ($reboot_type eq "grub2bls")) { +- run_ssh "$grub_reboot $grub_number"; ++ run_ssh "$grub_reboot \"'$grub_number'\""; + } elsif ($reboot_type eq "syslinux") { + run_ssh "$syslinux --once \\\"$syslinux_label\\\" $syslinux_path"; + } elsif (defined $reboot_script) { diff --git a/queue-5.15/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch b/queue-5.15/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch new file mode 100644 index 00000000000..6163eaacfb5 --- /dev/null +++ b/queue-5.15/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch @@ -0,0 +1,45 @@ +From ef784eebb56425eed6e9b16e7d47e5c00dcf9c38 Mon Sep 17 00:00:00 2001 +From: Steven Rostedt +Date: Fri, 2 Dec 2022 11:59:36 -0500 +Subject: ktest.pl minconfig: Unset configs instead of just removing them + +From: Steven Rostedt + +commit ef784eebb56425eed6e9b16e7d47e5c00dcf9c38 upstream. + +After a full run of a make_min_config test, I noticed there were a lot of +CONFIGs still enabled that really should not be. Looking at them, I +noticed they were all defined as "default y". The issue is that the test +simple removes the config and re-runs make oldconfig, which enables it +again because it is set to default 'y'. Instead, explicitly disable the +config with writing "# CONFIG_FOO is not set" to the file to keep it from +being set again. + +With this change, one of my box's minconfigs went from 768 configs set, +down to 521 configs set. + +Link: https://lkml.kernel.org/r/20221202115936.016fce23@gandalf.local.home + +Cc: stable@vger.kernel.org +Fixes: 0a05c769a9de5 ("ktest: Added config_bisect test type") +Reviewed-by: John 'Warthog9' Hawley (VMware) +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/ktest/ktest.pl | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/tools/testing/ktest/ktest.pl ++++ b/tools/testing/ktest/ktest.pl +@@ -3778,9 +3778,10 @@ sub test_this_config { + # .config to make sure it is missing the config that + # we had before + my %configs = %min_configs; +- delete $configs{$config}; ++ $configs{$config} = "# $config is not set"; + make_new_config ((values %configs), (values %keep_configs)); + make_oldconfig; ++ delete $configs{$config}; + undef %configs; + assign_configs \%configs, $output_config; + diff --git a/queue-5.15/media-stv0288-use-explicitly-signed-char.patch b/queue-5.15/media-stv0288-use-explicitly-signed-char.patch new file mode 100644 index 00000000000..8d69e709096 --- /dev/null +++ b/queue-5.15/media-stv0288-use-explicitly-signed-char.patch @@ -0,0 +1,40 @@ +From 7392134428c92a4cb541bd5c8f4f5c8d2e88364d Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Mon, 24 Oct 2022 17:23:43 +0200 +Subject: media: stv0288: use explicitly signed char + +From: Jason A. Donenfeld + +commit 7392134428c92a4cb541bd5c8f4f5c8d2e88364d upstream. + +With char becoming unsigned by default, and with `char` alone being +ambiguous and based on architecture, signed chars need to be marked +explicitly as such. Use `s8` and `u8` types here, since that's what +surrounding code does. This fixes: + +drivers/media/dvb-frontends/stv0288.c:471 stv0288_set_frontend() warn: assigning (-9) to unsigned variable 'tm' +drivers/media/dvb-frontends/stv0288.c:471 stv0288_set_frontend() warn: we never enter this loop + +Cc: Mauro Carvalho Chehab +Cc: linux-media@vger.kernel.org +Cc: stable@vger.kernel.org +Signed-off-by: Jason A. Donenfeld +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/dvb-frontends/stv0288.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/media/dvb-frontends/stv0288.c ++++ b/drivers/media/dvb-frontends/stv0288.c +@@ -440,9 +440,8 @@ static int stv0288_set_frontend(struct d + struct stv0288_state *state = fe->demodulator_priv; + struct dtv_frontend_properties *c = &fe->dtv_property_cache; + +- char tm; +- unsigned char tda[3]; +- u8 reg, time_out = 0; ++ u8 tda[3], reg, time_out = 0; ++ s8 tm; + + dprintk("%s : FE_SET_FRONTEND\n", __func__); + diff --git a/queue-5.15/mmc-sdhci-sprd-disable-clk_auto-when-the-clock-is-less-than-400k.patch b/queue-5.15/mmc-sdhci-sprd-disable-clk_auto-when-the-clock-is-less-than-400k.patch new file mode 100644 index 00000000000..67eba73ac6d --- /dev/null +++ b/queue-5.15/mmc-sdhci-sprd-disable-clk_auto-when-the-clock-is-less-than-400k.patch @@ -0,0 +1,47 @@ +From ff874dbc4f868af128b412a9bd92637103cf11d7 Mon Sep 17 00:00:00 2001 +From: Wenchao Chen +Date: Wed, 7 Dec 2022 13:19:09 +0800 +Subject: mmc: sdhci-sprd: Disable CLK_AUTO when the clock is less than 400K + +From: Wenchao Chen + +commit ff874dbc4f868af128b412a9bd92637103cf11d7 upstream. + +When the clock is less than 400K, some SD cards fail to initialize +because CLK_AUTO is enabled. + +Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller") +Signed-off-by: Wenchao Chen +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20221207051909.32126-1-wenchao.chen@unisoc.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/sdhci-sprd.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +--- a/drivers/mmc/host/sdhci-sprd.c ++++ b/drivers/mmc/host/sdhci-sprd.c +@@ -224,13 +224,15 @@ static inline void _sdhci_sprd_set_clock + div = ((div & 0x300) >> 2) | ((div & 0xFF) << 8); + sdhci_enable_clk(host, div); + +- /* enable auto gate sdhc_enable_auto_gate */ +- val = sdhci_readl(host, SDHCI_SPRD_REG_32_BUSY_POSI); +- mask = SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN | +- SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN; +- if (mask != (val & mask)) { +- val |= mask; +- sdhci_writel(host, val, SDHCI_SPRD_REG_32_BUSY_POSI); ++ /* Enable CLK_AUTO when the clock is greater than 400K. */ ++ if (clk > 400000) { ++ val = sdhci_readl(host, SDHCI_SPRD_REG_32_BUSY_POSI); ++ mask = SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN | ++ SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN; ++ if (mask != (val & mask)) { ++ val |= mask; ++ sdhci_writel(host, val, SDHCI_SPRD_REG_32_BUSY_POSI); ++ } + } + } + diff --git a/queue-5.15/perf-x86-intel-uncore-clear-attr_update-properly.patch b/queue-5.15/perf-x86-intel-uncore-clear-attr_update-properly.patch new file mode 100644 index 00000000000..afcb8a86365 --- /dev/null +++ b/queue-5.15/perf-x86-intel-uncore-clear-attr_update-properly.patch @@ -0,0 +1,61 @@ +From 6532783310e2b2f50dc13f46c49aa6546cb6e7a3 Mon Sep 17 00:00:00 2001 +From: Alexander Antonov +Date: Thu, 17 Nov 2022 12:28:25 +0000 +Subject: perf/x86/intel/uncore: Clear attr_update properly + +From: Alexander Antonov + +commit 6532783310e2b2f50dc13f46c49aa6546cb6e7a3 upstream. + +Current clear_attr_update procedure in pmu_set_mapping() sets attr_update +field in NULL that is not correct because intel_uncore_type pmu types can +contain several groups in attr_update field. For example, SPR platform +already has uncore_alias_group to update and then UPI topology group will +be added in next patches. + +Fix current behavior and clear attr_update group related to mapping only. + +Fixes: bb42b3d39781 ("perf/x86/intel/uncore: Expose an Uncore unit to IIO PMON mapping") +Signed-off-by: Alexander Antonov +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Kan Liang +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20221117122833.3103580-4-alexander.antonov@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/events/intel/uncore_snbep.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +--- a/arch/x86/events/intel/uncore_snbep.c ++++ b/arch/x86/events/intel/uncore_snbep.c +@@ -3804,6 +3804,21 @@ static const struct attribute_group *skx + NULL, + }; + ++static void pmu_clear_mapping_attr(const struct attribute_group **groups, ++ struct attribute_group *ag) ++{ ++ int i; ++ ++ for (i = 0; groups[i]; i++) { ++ if (groups[i] == ag) { ++ for (i++; groups[i]; i++) ++ groups[i - 1] = groups[i]; ++ groups[i - 1] = NULL; ++ break; ++ } ++ } ++} ++ + static int + pmu_iio_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag) + { +@@ -3852,7 +3867,7 @@ clear_attrs: + clear_topology: + kfree(type->topology); + clear_attr_update: +- type->attr_update = NULL; ++ pmu_clear_mapping_attr(type->attr_update, ag); + return ret; + } + diff --git a/queue-5.15/perf-x86-intel-uncore-disable-i-o-stacks-to-pmu-mapping-on-icx-d.patch b/queue-5.15/perf-x86-intel-uncore-disable-i-o-stacks-to-pmu-mapping-on-icx-d.patch new file mode 100644 index 00000000000..4ded1f1b9f1 --- /dev/null +++ b/queue-5.15/perf-x86-intel-uncore-disable-i-o-stacks-to-pmu-mapping-on-icx-d.patch @@ -0,0 +1,48 @@ +From efe062705d149b20a15498cb999a9edbb8241e6f Mon Sep 17 00:00:00 2001 +From: Alexander Antonov +Date: Thu, 17 Nov 2022 12:28:26 +0000 +Subject: perf/x86/intel/uncore: Disable I/O stacks to PMU mapping on ICX-D + +From: Alexander Antonov + +commit efe062705d149b20a15498cb999a9edbb8241e6f upstream. + +Current implementation of I/O stacks to PMU mapping doesn't support ICX-D. +Detect ICX-D system to disable mapping. + +Fixes: 10337e95e04c ("perf/x86/intel/uncore: Enable I/O stacks to IIO PMON mapping on ICX") +Signed-off-by: Alexander Antonov +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Kan Liang +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20221117122833.3103580-5-alexander.antonov@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/events/intel/uncore.h | 1 + + arch/x86/events/intel/uncore_snbep.c | 5 +++++ + 2 files changed, 6 insertions(+) + +--- a/arch/x86/events/intel/uncore.h ++++ b/arch/x86/events/intel/uncore.h +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #include + + #include +--- a/arch/x86/events/intel/uncore_snbep.c ++++ b/arch/x86/events/intel/uncore_snbep.c +@@ -5144,6 +5144,11 @@ static int icx_iio_get_topology(struct i + + static int icx_iio_set_mapping(struct intel_uncore_type *type) + { ++ /* Detect ICX-D system. This case is not supported */ ++ if (boot_cpu_data.x86_model == INTEL_FAM6_ICELAKE_D) { ++ pmu_clear_mapping_attr(type->attr_update, &icx_iio_mapping_group); ++ return -EPERM; ++ } + return pmu_iio_set_mapping(type, &icx_iio_mapping_group); + } + diff --git a/queue-5.15/pm-devfreq-governor-add-a-private-governor_data-for-governor.patch b/queue-5.15/pm-devfreq-governor-add-a-private-governor_data-for-governor.patch new file mode 100644 index 00000000000..3f7f15db009 --- /dev/null +++ b/queue-5.15/pm-devfreq-governor-add-a-private-governor_data-for-governor.patch @@ -0,0 +1,144 @@ +From 5fdded8448924e3631d466eea499b11606c43640 Mon Sep 17 00:00:00 2001 +From: Kant Fan +Date: Tue, 25 Oct 2022 15:21:09 +0800 +Subject: PM/devfreq: governor: Add a private governor_data for governor + +From: Kant Fan + +commit 5fdded8448924e3631d466eea499b11606c43640 upstream. + +The member void *data in the structure devfreq can be overwrite +by governor_userspace. For example: +1. The device driver assigned the devfreq governor to simple_ondemand +by the function devfreq_add_device() and init the devfreq member +void *data to a pointer of a static structure devfreq_simple_ondemand_data +by the function devfreq_add_device(). +2. The user changed the devfreq governor to userspace by the command +"echo userspace > /sys/class/devfreq/.../governor". +3. The governor userspace alloced a dynamic memory for the struct +userspace_data and assigend the member void *data of devfreq to +this memory by the function userspace_init(). +4. The user changed the devfreq governor back to simple_ondemand +by the command "echo simple_ondemand > /sys/class/devfreq/.../governor". +5. The governor userspace exited and assigned the member void *data +in the structure devfreq to NULL by the function userspace_exit(). +6. The governor simple_ondemand fetched the static information of +devfreq_simple_ondemand_data in the function +devfreq_simple_ondemand_func() but the member void *data of devfreq was +assigned to NULL by the function userspace_exit(). +7. The information of upthreshold and downdifferential is lost +and the governor simple_ondemand can't work correctly. + +The member void *data in the structure devfreq is designed for +a static pointer used in a governor and inited by the function +devfreq_add_device(). This patch add an element named governor_data +in the devfreq structure which can be used by a governor(E.g userspace) +who want to assign a private data to do some private things. + +Fixes: ce26c5bb9569 ("PM / devfreq: Add basic governors") +Cc: stable@vger.kernel.org # 5.10+ +Reviewed-by: Chanwoo Choi +Acked-by: MyungJoo Ham +Signed-off-by: Kant Fan +Signed-off-by: Chanwoo Choi +Signed-off-by: Greg Kroah-Hartman +--- + drivers/devfreq/devfreq.c | 6 ++---- + drivers/devfreq/governor_userspace.c | 12 ++++++------ + include/linux/devfreq.h | 7 ++++--- + 3 files changed, 12 insertions(+), 13 deletions(-) + +--- a/drivers/devfreq/devfreq.c ++++ b/drivers/devfreq/devfreq.c +@@ -775,8 +775,7 @@ static void remove_sysfs_files(struct de + * @dev: the device to add devfreq feature. + * @profile: device-specific profile to run devfreq. + * @governor_name: name of the policy to choose frequency. +- * @data: private data for the governor. The devfreq framework does not +- * touch this value. ++ * @data: devfreq driver pass to governors, governor should not change it. + */ + struct devfreq *devfreq_add_device(struct device *dev, + struct devfreq_dev_profile *profile, +@@ -1003,8 +1002,7 @@ static void devm_devfreq_dev_release(str + * @dev: the device to add devfreq feature. + * @profile: device-specific profile to run devfreq. + * @governor_name: name of the policy to choose frequency. +- * @data: private data for the governor. The devfreq framework does not +- * touch this value. ++ * @data: devfreq driver pass to governors, governor should not change it. + * + * This function manages automatically the memory of devfreq device using device + * resource management and simplify the free operation for memory of devfreq +--- a/drivers/devfreq/governor_userspace.c ++++ b/drivers/devfreq/governor_userspace.c +@@ -21,7 +21,7 @@ struct userspace_data { + + static int devfreq_userspace_func(struct devfreq *df, unsigned long *freq) + { +- struct userspace_data *data = df->data; ++ struct userspace_data *data = df->governor_data; + + if (data->valid) + *freq = data->user_frequency; +@@ -40,7 +40,7 @@ static ssize_t set_freq_store(struct dev + int err = 0; + + mutex_lock(&devfreq->lock); +- data = devfreq->data; ++ data = devfreq->governor_data; + + sscanf(buf, "%lu", &wanted); + data->user_frequency = wanted; +@@ -60,7 +60,7 @@ static ssize_t set_freq_show(struct devi + int err = 0; + + mutex_lock(&devfreq->lock); +- data = devfreq->data; ++ data = devfreq->governor_data; + + if (data->valid) + err = sprintf(buf, "%lu\n", data->user_frequency); +@@ -91,7 +91,7 @@ static int userspace_init(struct devfreq + goto out; + } + data->valid = false; +- devfreq->data = data; ++ devfreq->governor_data = data; + + err = sysfs_create_group(&devfreq->dev.kobj, &dev_attr_group); + out: +@@ -107,8 +107,8 @@ static void userspace_exit(struct devfre + if (devfreq->dev.kobj.sd) + sysfs_remove_group(&devfreq->dev.kobj, &dev_attr_group); + +- kfree(devfreq->data); +- devfreq->data = NULL; ++ kfree(devfreq->governor_data); ++ devfreq->governor_data = NULL; + } + + static int devfreq_userspace_handler(struct devfreq *devfreq, +--- a/include/linux/devfreq.h ++++ b/include/linux/devfreq.h +@@ -149,8 +149,8 @@ struct devfreq_stats { + * @work: delayed work for load monitoring. + * @previous_freq: previously configured frequency value. + * @last_status: devfreq user device info, performance statistics +- * @data: Private data of the governor. The devfreq framework does not +- * touch this. ++ * @data: devfreq driver pass to governors, governor should not change it. ++ * @governor_data: private data for governors, devfreq core doesn't touch it. + * @user_min_freq_req: PM QoS minimum frequency request from user (via sysfs) + * @user_max_freq_req: PM QoS maximum frequency request from user (via sysfs) + * @scaling_min_freq: Limit minimum frequency requested by OPP interface +@@ -187,7 +187,8 @@ struct devfreq { + unsigned long previous_freq; + struct devfreq_dev_status last_status; + +- void *data; /* private data for governors */ ++ void *data; ++ void *governor_data; + + struct dev_pm_qos_request user_min_freq_req; + struct dev_pm_qos_request user_max_freq_req; diff --git a/queue-5.15/selftests-use-optional-usercflags-and-userldflags.patch b/queue-5.15/selftests-use-optional-usercflags-and-userldflags.patch new file mode 100644 index 00000000000..4fba0e8a425 --- /dev/null +++ b/queue-5.15/selftests-use-optional-usercflags-and-userldflags.patch @@ -0,0 +1,45 @@ +From de3ee3f63400a23954e7c1ad1cb8c20f29ab6fe3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= +Date: Fri, 9 Sep 2022 12:39:01 +0200 +Subject: selftests: Use optional USERCFLAGS and USERLDFLAGS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Mickaël Salaün + +commit de3ee3f63400a23954e7c1ad1cb8c20f29ab6fe3 upstream. + +This change enables to extend CFLAGS and LDFLAGS from command line, e.g. +to extend compiler checks: make USERCFLAGS=-Werror USERLDFLAGS=-static + +USERCFLAGS and USERLDFLAGS are documented in +Documentation/kbuild/makefiles.rst and Documentation/kbuild/kbuild.rst + +This should be backported (down to 5.10) to improve previous kernel +versions testing as well. + +Cc: Shuah Khan +Cc: stable@vger.kernel.org +Signed-off-by: Mickaël Salaün +Link: https://lore.kernel.org/r/20220909103901.1503436-1-mic@digikod.net +Signed-off-by: Shuah Khan +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/selftests/lib.mk | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/tools/testing/selftests/lib.mk ++++ b/tools/testing/selftests/lib.mk +@@ -129,6 +129,11 @@ endef + clean: + $(CLEAN) + ++# Enables to extend CFLAGS and LDFLAGS from command line, e.g. ++# make USERCFLAGS=-Werror USERLDFLAGS=-static ++CFLAGS += $(USERCFLAGS) ++LDFLAGS += $(USERLDFLAGS) ++ + # When make O= with kselftest target from main level + # the following aren't defined. + # diff --git a/queue-5.15/series b/queue-5.15/series index 136f26ad4be..75b6adec288 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -57,3 +57,18 @@ asoc-soundwire-dai-expand-stream-concept-beyond-soundwire.patch rcu-tasks-simplify-trc_read_check_handler-atomic-operations.patch net-af_packet-add-vlan-support-for-af_packet-sock_raw-gso.patch net-af_packet-make-sure-to-pull-mac-header.patch +media-stv0288-use-explicitly-signed-char.patch +soc-qcom-select-remap_mmio-for-llcc-driver.patch +kest.pl-fix-grub2-menu-handling-for-rebooting.patch +ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch +jbd2-use-the-correct-print-format.patch +perf-x86-intel-uncore-disable-i-o-stacks-to-pmu-mapping-on-icx-d.patch +perf-x86-intel-uncore-clear-attr_update-properly.patch +arm64-dts-qcom-sdm845-db845c-correct-spi2-pins-drive-strength.patch +mmc-sdhci-sprd-disable-clk_auto-when-the-clock-is-less-than-400k.patch +btrfs-fix-resolving-backrefs-for-inline-extent-followed-by-prealloc.patch +arm-ux500-do-not-directly-dereference-__iomem.patch +arm64-dts-qcom-sdm850-lenovo-yoga-c630-correct-i2c12-pins-drive-strength.patch +selftests-use-optional-usercflags-and-userldflags.patch +pm-devfreq-governor-add-a-private-governor_data-for-governor.patch +cpufreq-init-completion-before-kobject_init_and_add.patch diff --git a/queue-5.15/soc-qcom-select-remap_mmio-for-llcc-driver.patch b/queue-5.15/soc-qcom-select-remap_mmio-for-llcc-driver.patch new file mode 100644 index 00000000000..2595eb7d60b --- /dev/null +++ b/queue-5.15/soc-qcom-select-remap_mmio-for-llcc-driver.patch @@ -0,0 +1,38 @@ +From 5d2fe2d7b616b8baa18348ead857b504fc2de336 Mon Sep 17 00:00:00 2001 +From: Manivannan Sadhasivam +Date: Tue, 29 Nov 2022 12:41:59 +0530 +Subject: soc: qcom: Select REMAP_MMIO for LLCC driver + +From: Manivannan Sadhasivam + +commit 5d2fe2d7b616b8baa18348ead857b504fc2de336 upstream. + +LLCC driver uses REGMAP_MMIO for accessing the hardware registers. So +select the dependency in Kconfig. Without this, there will be errors +while building the driver with COMPILE_TEST only: + +ERROR: modpost: "__devm_regmap_init_mmio_clk" [drivers/soc/qcom/llcc-qcom.ko] undefined! +make[1]: *** [scripts/Makefile.modpost:126: Module.symvers] Error 1 +make: *** [Makefile:1944: modpost] Error 2 + +Cc: # 4.19 +Fixes: a3134fb09e0b ("drivers: soc: Add LLCC driver") +Reported-by: Borislav Petkov +Signed-off-by: Manivannan Sadhasivam +Signed-off-by: Bjorn Andersson +Link: https://lore.kernel.org/r/20221129071201.30024-2-manivannan.sadhasivam@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/soc/qcom/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/soc/qcom/Kconfig ++++ b/drivers/soc/qcom/Kconfig +@@ -63,6 +63,7 @@ config QCOM_GSBI + config QCOM_LLCC + tristate "Qualcomm Technologies, Inc. LLCC driver" + depends on ARCH_QCOM || COMPILE_TEST ++ select REGMAP_MMIO + help + Qualcomm Technologies, Inc. platform specific + Last Level Cache Controller(LLCC) driver for platforms such as,