From: Greg Kroah-Hartman Date: Wed, 4 Jan 2023 13:04:04 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v6.1.4~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f4a129feb79685feafbc5a80b688541e110bfe35;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: arm-ux500-do-not-directly-dereference-__iomem.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 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 selftests-use-optional-usercflags-and-userldflags.patch soc-qcom-select-remap_mmio-for-llcc-driver.patch --- diff --git a/queue-5.4/arm-ux500-do-not-directly-dereference-__iomem.patch b/queue-5.4/arm-ux500-do-not-directly-dereference-__iomem.patch new file mode 100644 index 00000000000..c47f914bd0d --- /dev/null +++ b/queue-5.4/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 +@@ -159,20 +159,18 @@ static ssize_t ux500_get_process(struct + 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.4/arm64-dts-qcom-sdm850-lenovo-yoga-c630-correct-i2c12-pins-drive-strength.patch b/queue-5.4/arm64-dts-qcom-sdm850-lenovo-yoga-c630-correct-i2c12-pins-drive-strength.patch new file mode 100644 index 00000000000..aa669a01217 --- /dev/null +++ b/queue-5.4/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 +@@ -298,8 +298,10 @@ + }; + + &qup_i2c12_default { +- drive-strength = <2>; +- bias-disable; ++ pinmux { ++ drive-strength = <2>; ++ bias-disable; ++ }; + }; + + &qup_uart6_default { diff --git a/queue-5.4/btrfs-fix-resolving-backrefs-for-inline-extent-followed-by-prealloc.patch b/queue-5.4/btrfs-fix-resolving-backrefs-for-inline-extent-followed-by-prealloc.patch new file mode 100644 index 00000000000..3f4d3fe4e59 --- /dev/null +++ b/queue-5.4/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 +@@ -431,6 +431,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]; +@@ -485,6 +486,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.4/cpufreq-init-completion-before-kobject_init_and_add.patch b/queue-5.4/cpufreq-init-completion-before-kobject_init_and_add.patch new file mode 100644 index 00000000000..f38c3d07e01 --- /dev/null +++ b/queue-5.4/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 +@@ -1204,6 +1204,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) { +@@ -1242,7 +1243,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.4/kest.pl-fix-grub2-menu-handling-for-rebooting.patch b/queue-5.4/kest.pl-fix-grub2-menu-handling-for-rebooting.patch new file mode 100644 index 00000000000..3f18d823291 --- /dev/null +++ b/queue-5.4/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 +@@ -1881,7 +1881,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) && +@@ -1898,11 +1898,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++; + } +@@ -1911,6 +1916,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; +@@ -1921,6 +1929,7 @@ sub get_grub_index { + my $command; + my $target; + my $skip; ++ my $submenu; + my $grub_menu_qt; + + if ($reboot_type !~ /^grub/) { +@@ -1935,8 +1944,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; +@@ -1945,7 +1955,7 @@ sub get_grub_index { + return; + } + +- _get_grub_index($command, $target, $skip); ++ _get_grub_index($command, $target, $skip, $submenu); + } + + sub wait_for_input +@@ -2009,7 +2019,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.4/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch b/queue-5.4/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch new file mode 100644 index 00000000000..69863c5cba1 --- /dev/null +++ b/queue-5.4/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 +@@ -3736,9 +3736,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.4/media-stv0288-use-explicitly-signed-char.patch b/queue-5.4/media-stv0288-use-explicitly-signed-char.patch new file mode 100644 index 00000000000..8d69e709096 --- /dev/null +++ b/queue-5.4/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.4/mmc-sdhci-sprd-disable-clk_auto-when-the-clock-is-less-than-400k.patch b/queue-5.4/mmc-sdhci-sprd-disable-clk_auto-when-the-clock-is-less-than-400k.patch new file mode 100644 index 00000000000..b4e1cb19f53 --- /dev/null +++ b/queue-5.4/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 +@@ -223,13 +223,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.4/selftests-use-optional-usercflags-and-userldflags.patch b/queue-5.4/selftests-use-optional-usercflags-and-userldflags.patch new file mode 100644 index 00000000000..0e9ad2e6f24 --- /dev/null +++ b/queue-5.4/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 +@@ -130,6 +130,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.4/series b/queue-5.4/series index 86b7e52549c..597c708aafa 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -476,3 +476,13 @@ tpm-tpm_tis-add-the-missed-acpi_put_table-to-fix-memory-leak.patch sunrpc-don-t-leak-netobj-memory-when-gss_read_proxy_verf-fails.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 +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 +cpufreq-init-completion-before-kobject_init_and_add.patch diff --git a/queue-5.4/soc-qcom-select-remap_mmio-for-llcc-driver.patch b/queue-5.4/soc-qcom-select-remap_mmio-for-llcc-driver.patch new file mode 100644 index 00000000000..a21a6b18004 --- /dev/null +++ b/queue-5.4/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 +@@ -56,6 +56,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,