From 2410b24b1dd2d2ff3069a8e79390866e0729417d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 8 Sep 2019 13:06:48 +0100 Subject: [PATCH] 5.2-stable patches added patches: revert-mmc-core-do-not-retry-cmd6-in-__mmc_switch.patch x86-boot-preserve-boot_params.secure_boot-from-sanitizing.patch --- ...re-do-not-retry-cmd6-in-__mmc_switch.patch | 50 +++++++++++++++++ queue-5.2/series | 2 + ...t_params.secure_boot-from-sanitizing.patch | 56 +++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 queue-5.2/revert-mmc-core-do-not-retry-cmd6-in-__mmc_switch.patch create mode 100644 queue-5.2/x86-boot-preserve-boot_params.secure_boot-from-sanitizing.patch 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 index 00000000000..8cdf5028791 --- /dev/null +++ b/queue-5.2/revert-mmc-core-do-not-retry-cmd6-in-__mmc_switch.patch @@ -0,0 +1,50 @@ +From 8ad8e02c2fa70cfddc1ded53ba9001c9d444075d Mon Sep 17 00:00:00 2001 +From: Jan Kaisrlik +Date: Tue, 20 Aug 2019 13:42:29 +0200 +Subject: Revert "mmc: core: do not retry CMD6 in __mmc_switch()" + +From: Jan Kaisrlik + +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 +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman + +--- + 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; + diff --git a/queue-5.2/series b/queue-5.2/series index c7ae25d8572..141287d84e6 100644 --- a/queue-5.2/series +++ b/queue-5.2/series @@ -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 index 00000000000..e5bab5c7332 --- /dev/null +++ b/queue-5.2/x86-boot-preserve-boot_params.secure_boot-from-sanitizing.patch @@ -0,0 +1,56 @@ +From 29d9a0b50736768f042752070e5cdf4e4d4c00df Mon Sep 17 00:00:00 2001 +From: "John S. Gruber" +Date: Mon, 2 Sep 2019 00:00:54 +0200 +Subject: x86/boot: Preserve boot_params.secure_boot from sanitizing + +From: John S. Gruber + +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 +Signed-off-by: Borislav Petkov +Reviewed-by: John Hubbard +Cc: "H. Peter Anvin" +Cc: Ingo Molnar +Cc: Juergen Gross +Cc: Mark Brown +Cc: stable +Cc: Thomas Gleixner +Cc: x86-ml +Link: https://lkml.kernel.org/r/CAPotdmSPExAuQcy9iAHqX3js_fc4mMLQOTr5RBGvizyCOPcTQQ@mail.gmail.com +Signed-off-by: Greg Kroah-Hartman + +--- + 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), -- 2.47.3