]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.2-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Sep 2019 12:06:48 +0000 (13:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Sep 2019 12:06:48 +0000 (13:06 +0100)
added patches:
revert-mmc-core-do-not-retry-cmd6-in-__mmc_switch.patch
x86-boot-preserve-boot_params.secure_boot-from-sanitizing.patch

queue-5.2/revert-mmc-core-do-not-retry-cmd6-in-__mmc_switch.patch [new file with mode: 0644]
queue-5.2/series
queue-5.2/x86-boot-preserve-boot_params.secure_boot-from-sanitizing.patch [new file with mode: 0644]

diff --git a/queue-5.2/revert-mmc-core-do-not-retry-cmd6-in-__mmc_switch.patch b/queue-5.2/revert-mmc-core-do-not-retry-cmd6-in-__mmc_switch.patch
new file mode 100644 (file)
index 0000000..8cdf502
--- /dev/null
@@ -0,0 +1,50 @@
+From 8ad8e02c2fa70cfddc1ded53ba9001c9d444075d Mon Sep 17 00:00:00 2001
+From: Jan Kaisrlik <ja.kaisrlik@gmail.com>
+Date: Tue, 20 Aug 2019 13:42:29 +0200
+Subject: Revert "mmc: core: do not retry CMD6 in __mmc_switch()"
+
+From: Jan Kaisrlik <ja.kaisrlik@gmail.com>
+
+commit 8ad8e02c2fa70cfddc1ded53ba9001c9d444075d upstream.
+
+Turns out the commit 3a0681c7448b ("mmc: core: do not retry CMD6 in
+__mmc_switch()") breaks initialization of a Toshiba THGBMNG5 eMMC card,
+when using the meson-gx-mmc.c driver on a custom board based on Amlogic
+A113D.
+
+The CMD6 that switches the card into HS200 mode is then one that fails and
+according to the below printed messages from the log:
+
+[    1.648951] mmc0: mmc_select_hs200 failed, error -84
+[    1.648988] mmc0: error -84 whilst initialising MMC card
+
+After some analyze, it turns out that adding a delay of ~5ms inside
+mmc_select_bus_width() but after mmc_compare_ext_csds() has been executed,
+also fixes the problem. Adding yet some more debug code, trying to figure
+out if potentially the card could be in a busy state, both by using CMD13
+and ->card_busy() ops concluded that this was not the case.
+
+Therefore, let's simply revert the commit that dropped support for retrying
+of CMD6, as this also fixes the problem.
+
+Fixes: 3a0681c7448b ("mmc: core: do not retry CMD6 in __mmc_switch()")
+Cc: stable@vger.kernel.org
+Signed-off-by: Jan Kaisrlik <ja.kaisrlik@gmail.com>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/core/mmc_ops.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/mmc/core/mmc_ops.c
++++ b/drivers/mmc/core/mmc_ops.c
+@@ -564,7 +564,7 @@ int __mmc_switch(struct mmc_card *card,
+       if (index == EXT_CSD_SANITIZE_START)
+               cmd.sanitize_busy = true;
+-      err = mmc_wait_for_cmd(host, &cmd, 0);
++      err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
+       if (err)
+               goto out;
index c7ae25d85724ddd8ace6e35ecfb382c84ec32c74..141287d84e6b25c6cee57d472ea91e426d410837 100644 (file)
@@ -90,3 +90,5 @@ kvm-arm-arm64-vgic-properly-initialise-private-irq-a.patch
 x86-boot-compressed-64-fix-missing-initialization-in.patch
 libceph-allow-ceph_buffer_put-to-receive-a-null-ceph.patch
 revert-x86-apic-include-the-ldr-when-clearing-out-ap.patch
+x86-boot-preserve-boot_params.secure_boot-from-sanitizing.patch
+revert-mmc-core-do-not-retry-cmd6-in-__mmc_switch.patch
diff --git a/queue-5.2/x86-boot-preserve-boot_params.secure_boot-from-sanitizing.patch b/queue-5.2/x86-boot-preserve-boot_params.secure_boot-from-sanitizing.patch
new file mode 100644 (file)
index 0000000..e5bab5c
--- /dev/null
@@ -0,0 +1,56 @@
+From 29d9a0b50736768f042752070e5cdf4e4d4c00df Mon Sep 17 00:00:00 2001
+From: "John S. Gruber" <JohnSGruber@gmail.com>
+Date: Mon, 2 Sep 2019 00:00:54 +0200
+Subject: x86/boot: Preserve boot_params.secure_boot from sanitizing
+
+From: John S. Gruber <JohnSGruber@gmail.com>
+
+commit 29d9a0b50736768f042752070e5cdf4e4d4c00df upstream.
+
+Commit
+
+  a90118c445cc ("x86/boot: Save fields explicitly, zero out everything else")
+
+now zeroes the secure boot setting information (enabled/disabled/...)
+passed by the boot loader or by the kernel's EFI handover mechanism.
+
+The problem manifests itself with signed kernels using the EFI handoff
+protocol with grub and the kernel loses the information whether secure
+boot is enabled in the firmware, i.e., the log message "Secure boot
+enabled" becomes "Secure boot could not be determined".
+
+efi_main() arch/x86/boot/compressed/eboot.c sets this field early but it
+is subsequently zeroed by the above referenced commit.
+
+Include boot_params.secure_boot in the preserve field list.
+
+ [ bp: restructure commit message and massage. ]
+
+Fixes: a90118c445cc ("x86/boot: Save fields explicitly, zero out everything else")
+Signed-off-by: John S. Gruber <JohnSGruber@gmail.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Reviewed-by: John Hubbard <jhubbard@nvidia.com>
+Cc: "H. Peter Anvin" <hpa@zytor.com>
+Cc: Ingo Molnar <mingo@redhat.com>
+Cc: Juergen Gross <jgross@suse.com>
+Cc: Mark Brown <broonie@kernel.org>
+Cc: stable <stable@vger.kernel.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: x86-ml <x86@kernel.org>
+Link: https://lkml.kernel.org/r/CAPotdmSPExAuQcy9iAHqX3js_fc4mMLQOTr5RBGvizyCOPcTQQ@mail.gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/include/asm/bootparam_utils.h |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/x86/include/asm/bootparam_utils.h
++++ b/arch/x86/include/asm/bootparam_utils.h
+@@ -70,6 +70,7 @@ static void sanitize_boot_params(struct
+                       BOOT_PARAM_PRESERVE(eddbuf_entries),
+                       BOOT_PARAM_PRESERVE(edd_mbr_sig_buf_entries),
+                       BOOT_PARAM_PRESERVE(edd_mbr_sig_buffer),
++                      BOOT_PARAM_PRESERVE(secure_boot),
+                       BOOT_PARAM_PRESERVE(hdr),
+                       BOOT_PARAM_PRESERVE(e820_table),
+                       BOOT_PARAM_PRESERVE(eddbuf),