From: Sasha Levin Date: Fri, 17 Jul 2020 12:55:59 +0000 (-0400) Subject: Fixes for 5.7 X-Git-Tag: v4.4.231~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=113842f6ad8e872213deec54d4890cb2da9415b4;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.7 Signed-off-by: Sasha Levin --- diff --git a/queue-5.7/acpi-dptf-add-battery-participant-for-tigerlake.patch b/queue-5.7/acpi-dptf-add-battery-participant-for-tigerlake.patch new file mode 100644 index 00000000000..99276621481 --- /dev/null +++ b/queue-5.7/acpi-dptf-add-battery-participant-for-tigerlake.patch @@ -0,0 +1,35 @@ +From 08e0a931eaf4c965b8424a1df231283a32f72e06 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Jun 2020 11:51:40 -0700 +Subject: ACPI: DPTF: Add battery participant for TigerLake + +From: Srinivas Pandruvada + +[ Upstream commit 1e05daca83bb42cde569f75f3bd7c8828b1ef30f ] + +Add DPTF battery participant ACPI ID for platforms based on the Intel +TigerLake SoC. + +Signed-off-by: Srinivas Pandruvada +[ rjw: Changelog ] +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + drivers/acpi/dptf/dptf_power.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/acpi/dptf/dptf_power.c b/drivers/acpi/dptf/dptf_power.c +index e4e8b75d39f09..8b42f529047e9 100644 +--- a/drivers/acpi/dptf/dptf_power.c ++++ b/drivers/acpi/dptf/dptf_power.c +@@ -99,6 +99,7 @@ static int dptf_power_remove(struct platform_device *pdev) + static const struct acpi_device_id int3407_device_ids[] = { + {"INT3407", 0}, + {"INTC1047", 0}, ++ {"INTC1050", 0}, + {"", 0}, + }; + MODULE_DEVICE_TABLE(acpi, int3407_device_ids); +-- +2.25.1 + diff --git a/queue-5.7/arm64-add-kryo4xx-gold-cpu-cores-to-erratum-list-146.patch b/queue-5.7/arm64-add-kryo4xx-gold-cpu-cores-to-erratum-list-146.patch new file mode 100644 index 00000000000..effbb80f19c --- /dev/null +++ b/queue-5.7/arm64-add-kryo4xx-gold-cpu-cores-to-erratum-list-146.patch @@ -0,0 +1,93 @@ +From eca7a48206ebda1e44b8f53e146910fb5290f90f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 Jun 2020 23:30:54 +0530 +Subject: arm64: Add KRYO4XX gold CPU cores to erratum list 1463225 and 1418040 + +From: Sai Prakash Ranjan + +[ Upstream commit a9e821b89daa55cc940c546b124101939d3f0451 ] + +KRYO4XX gold/big CPU core revisions r0p0 to r3p1 are affected by +erratum 1463225 and 1418040, so add them to the respective list. +The variant and revision bits are implementation defined and are +different from the their Cortex CPU counterparts on which they are +based on, i.e., (r0p0 to r3p1) is equivalent to (rcpe to rfpf). + +Signed-off-by: Sai Prakash Ranjan +Link: https://lore.kernel.org/r/83780e80c6377c12ca51b5d53186b61241685e49.1593539394.git.saiprakash.ranjan@codeaurora.org +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + Documentation/arm64/silicon-errata.rst | 4 ++++ + arch/arm64/kernel/cpu_errata.c | 19 +++++++++++++------ + 2 files changed, 17 insertions(+), 6 deletions(-) + +diff --git a/Documentation/arm64/silicon-errata.rst b/Documentation/arm64/silicon-errata.rst +index 2c08c628febdf..6902feba6b412 100644 +--- a/Documentation/arm64/silicon-errata.rst ++++ b/Documentation/arm64/silicon-errata.rst +@@ -147,6 +147,10 @@ stable kernels. + +----------------+-----------------+-----------------+-----------------------------+ + | Qualcomm Tech. | Falkor v{1,2} | E1041 | QCOM_FALKOR_ERRATUM_1041 | + +----------------+-----------------+-----------------+-----------------------------+ ++| Qualcomm Tech. | Kryo4xx Gold | N/A | ARM64_ERRATUM_1463225 | +++----------------+-----------------+-----------------+-----------------------------+ ++| Qualcomm Tech. | Kryo4xx Gold | N/A | ARM64_ERRATUM_1418040 | +++----------------+-----------------+-----------------+-----------------------------+ + +----------------+-----------------+-----------------+-----------------------------+ + | Fujitsu | A64FX | E#010001 | FUJITSU_ERRATUM_010001 | + +----------------+-----------------+-----------------+-----------------------------+ +diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c +index 0f37045fafab3..e0f8474979b19 100644 +--- a/arch/arm64/kernel/cpu_errata.c ++++ b/arch/arm64/kernel/cpu_errata.c +@@ -472,12 +472,7 @@ static bool + has_cortex_a76_erratum_1463225(const struct arm64_cpu_capabilities *entry, + int scope) + { +- u32 midr = read_cpuid_id(); +- /* Cortex-A76 r0p0 - r3p1 */ +- struct midr_range range = MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 1); +- +- WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible()); +- return is_midr_in_range(midr, &range) && is_kernel_in_hyp_mode(); ++ return is_affected_midr_range_list(entry, scope) && is_kernel_in_hyp_mode(); + } + #endif + +@@ -728,6 +723,8 @@ static const struct midr_range erratum_1418040_list[] = { + MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 1), + /* Neoverse-N1 r0p0 to r3p1 */ + MIDR_RANGE(MIDR_NEOVERSE_N1, 0, 0, 3, 1), ++ /* Kryo4xx Gold (rcpe to rfpf) => (r0p0 to r3p1) */ ++ MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xf), + {}, + }; + #endif +@@ -773,6 +770,15 @@ static const struct midr_range erratum_speculative_at_vhe_list[] = { + }; + #endif + ++#ifdef CONFIG_ARM64_ERRATUM_1463225 ++static const struct midr_range erratum_1463225[] = { ++ /* Cortex-A76 r0p0 - r3p1 */ ++ MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 1), ++ /* Kryo4xx Gold (rcpe to rfpf) => (r0p0 to r3p1) */ ++ MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xf), ++}; ++#endif ++ + const struct arm64_cpu_capabilities arm64_errata[] = { + #ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE + { +@@ -912,6 +918,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = { + .capability = ARM64_WORKAROUND_1463225, + .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, + .matches = has_cortex_a76_erratum_1463225, ++ .midr_range_list = erratum_1463225, + }, + #endif + #ifdef CONFIG_CAVIUM_TX2_ERRATUM_219 +-- +2.25.1 + diff --git a/queue-5.7/arm64-add-kryo4xx-silver-cpu-cores-to-erratum-list-1.patch b/queue-5.7/arm64-add-kryo4xx-silver-cpu-cores-to-erratum-list-1.patch new file mode 100644 index 00000000000..123487151a5 --- /dev/null +++ b/queue-5.7/arm64-add-kryo4xx-silver-cpu-cores-to-erratum-list-1.patch @@ -0,0 +1,70 @@ +From 2e3f06f982d06a6036b7366ca4dafb274f4de280 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 Jun 2020 23:30:55 +0530 +Subject: arm64: Add KRYO4XX silver CPU cores to erratum list 1530923 and + 1024718 + +From: Sai Prakash Ranjan + +[ Upstream commit 9b23d95c539ebc5d6d6b5d6f20d2d7922384e76e ] + +KRYO4XX silver/LITTLE CPU cores with revision r1p0 are affected by +erratum 1530923 and 1024718, so add them to the respective list. +The variant and revision bits are implementation defined and are +different from the their Cortex CPU counterparts on which they are +based on, i.e., r1p0 is equivalent to rdpe. + +Signed-off-by: Sai Prakash Ranjan +Link: https://lore.kernel.org/r/7013e8a3f857ca7e82863cc9e34a614293d7f80c.1593539394.git.saiprakash.ranjan@codeaurora.org +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + Documentation/arm64/silicon-errata.rst | 4 ++++ + arch/arm64/kernel/cpu_errata.c | 2 ++ + arch/arm64/kernel/cpufeature.c | 2 ++ + 3 files changed, 8 insertions(+) + +diff --git a/Documentation/arm64/silicon-errata.rst b/Documentation/arm64/silicon-errata.rst +index 6902feba6b412..7dc8f8ac69eea 100644 +--- a/Documentation/arm64/silicon-errata.rst ++++ b/Documentation/arm64/silicon-errata.rst +@@ -151,6 +151,10 @@ stable kernels. + +----------------+-----------------+-----------------+-----------------------------+ + | Qualcomm Tech. | Kryo4xx Gold | N/A | ARM64_ERRATUM_1418040 | + +----------------+-----------------+-----------------+-----------------------------+ ++| Qualcomm Tech. | Kryo4xx Silver | N/A | ARM64_ERRATUM_1530923 | +++----------------+-----------------+-----------------+-----------------------------+ ++| Qualcomm Tech. | Kryo4xx Silver | N/A | ARM64_ERRATUM_1024718 | +++----------------+-----------------+-----------------+-----------------------------+ + +----------------+-----------------+-----------------+-----------------------------+ + | Fujitsu | A64FX | E#010001 | FUJITSU_ERRATUM_010001 | + +----------------+-----------------+-----------------+-----------------------------+ +diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c +index e0f8474979b19..dbf266212808e 100644 +--- a/arch/arm64/kernel/cpu_errata.c ++++ b/arch/arm64/kernel/cpu_errata.c +@@ -765,6 +765,8 @@ static const struct midr_range erratum_speculative_at_vhe_list[] = { + #ifdef CONFIG_ARM64_ERRATUM_1530923 + /* Cortex A55 r0p0 to r2p0 */ + MIDR_RANGE(MIDR_CORTEX_A55, 0, 0, 2, 0), ++ /* Kryo4xx Silver (rdpe => r1p0) */ ++ MIDR_REV(MIDR_QCOM_KRYO_4XX_SILVER, 0xd, 0xe), + #endif + {}, + }; +diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c +index b0fb1d5bf2235..cadc9d9a7477b 100644 +--- a/arch/arm64/kernel/cpufeature.c ++++ b/arch/arm64/kernel/cpufeature.c +@@ -1177,6 +1177,8 @@ static bool cpu_has_broken_dbm(void) + static const struct midr_range cpus[] = { + #ifdef CONFIG_ARM64_ERRATUM_1024718 + MIDR_RANGE(MIDR_CORTEX_A55, 0, 0, 1, 0), // A55 r0p0 -r1p0 ++ /* Kryo4xx Silver (rdpe => r1p0) */ ++ MIDR_REV(MIDR_QCOM_KRYO_4XX_SILVER, 0xd, 0xe), + #endif + {}, + }; +-- +2.25.1 + diff --git a/queue-5.7/arm64-add-midr-value-for-kryo4xx-gold-cpu-cores.patch b/queue-5.7/arm64-add-midr-value-for-kryo4xx-gold-cpu-cores.patch new file mode 100644 index 00000000000..00e02d4ae7b --- /dev/null +++ b/queue-5.7/arm64-add-midr-value-for-kryo4xx-gold-cpu-cores.patch @@ -0,0 +1,45 @@ +From 79053d96cd5a152793a6a02192911f2b5adfd04d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 Jun 2020 23:30:53 +0530 +Subject: arm64: Add MIDR value for KRYO4XX gold CPU cores + +From: Sai Prakash Ranjan + +[ Upstream commit dce4f2807f6920bb907eb4cd4f95e7f42d918bc6 ] + +Add MIDR value for KRYO4XX gold/big CPU cores which are +used in Qualcomm Technologies, Inc. SoCs. This will be +used to identify and apply erratum which are applicable +for these CPU cores. + +Signed-off-by: Sai Prakash Ranjan +Link: https://lore.kernel.org/r/9093fb82e22441076280ca1b729242ffde80c432.1593539394.git.saiprakash.ranjan@codeaurora.org +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + arch/arm64/include/asm/cputype.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h +index a87a93f67671d..7219cddeba669 100644 +--- a/arch/arm64/include/asm/cputype.h ++++ b/arch/arm64/include/asm/cputype.h +@@ -86,6 +86,7 @@ + #define QCOM_CPU_PART_FALKOR 0xC00 + #define QCOM_CPU_PART_KRYO 0x200 + #define QCOM_CPU_PART_KRYO_3XX_SILVER 0x803 ++#define QCOM_CPU_PART_KRYO_4XX_GOLD 0x804 + #define QCOM_CPU_PART_KRYO_4XX_SILVER 0x805 + + #define NVIDIA_CPU_PART_DENVER 0x003 +@@ -114,6 +115,7 @@ + #define MIDR_QCOM_FALKOR MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_FALKOR) + #define MIDR_QCOM_KRYO MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO) + #define MIDR_QCOM_KRYO_3XX_SILVER MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_3XX_SILVER) ++#define MIDR_QCOM_KRYO_4XX_GOLD MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_4XX_GOLD) + #define MIDR_QCOM_KRYO_4XX_SILVER MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_4XX_SILVER) + #define MIDR_NVIDIA_DENVER MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_DENVER) + #define MIDR_NVIDIA_CARMEL MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_CARMEL) +-- +2.25.1 + diff --git a/queue-5.7/arm64-alternatives-use-subsections-for-replacement-s.patch b/queue-5.7/arm64-alternatives-use-subsections-for-replacement-s.patch new file mode 100644 index 00000000000..1f30abec4be --- /dev/null +++ b/queue-5.7/arm64-alternatives-use-subsections-for-replacement-s.patch @@ -0,0 +1,136 @@ +From dfcac7e479777ee392b196c2003a785e54ad5253 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 Jun 2020 10:19:21 +0200 +Subject: arm64/alternatives: use subsections for replacement sequences + +From: Ard Biesheuvel + +[ Upstream commit f7b93d42945cc71e1346dd5ae07c59061d56745e ] + +When building very large kernels, the logic that emits replacement +sequences for alternatives fails when relative branches are present +in the code that is emitted into the .altinstr_replacement section +and patched in at the original site and fixed up. The reason is that +the linker will insert veneers if relative branches go out of range, +and due to the relative distance of the .altinstr_replacement from +the .text section where its branch targets usually live, veneers +may be emitted at the end of the .altinstr_replacement section, with +the relative branches in the sequence pointed at the veneers instead +of the actual target. + +The alternatives patching logic will attempt to fix up the branch to +point to its original target, which will be the veneer in this case, +but given that the patch site is likely to be far away as well, it +will be out of range and so patching will fail. There are other cases +where these veneers are problematic, e.g., when the target of the +branch is in .text while the patch site is in .init.text, in which +case putting the replacement sequence inside .text may not help either. + +So let's use subsections to emit the replacement code as closely as +possible to the patch site, to ensure that veneers are only likely to +be emitted if they are required at the patch site as well, in which +case they will be in range for the replacement sequence both before +and after it is transported to the patch site. + +This will prevent alternative sequences in non-init code from being +released from memory after boot, but this is tolerable given that the +entire section is only 512 KB on an allyesconfig build (which weighs in +at 500+ MB for the entire Image). Also, note that modules today carry +the replacement sequences in non-init sections as well, and any of +those that target init code will be emitted into init sections after +this change. + +This fixes an early crash when booting an allyesconfig kernel on a +system where any of the alternatives sequences containing relative +branches are activated at boot (e.g., ARM64_HAS_PAN on TX2) + +Signed-off-by: Ard Biesheuvel +Cc: Suzuki K Poulose +Cc: James Morse +Cc: Andre Przywara +Cc: Dave P Martin +Link: https://lore.kernel.org/r/20200630081921.13443-1-ardb@kernel.org +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + arch/arm64/include/asm/alternative.h | 16 ++++++++-------- + arch/arm64/kernel/vmlinux.lds.S | 3 --- + 2 files changed, 8 insertions(+), 11 deletions(-) + +diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h +index 5e5dc05d63a06..12f0eb56a1cc3 100644 +--- a/arch/arm64/include/asm/alternative.h ++++ b/arch/arm64/include/asm/alternative.h +@@ -73,11 +73,11 @@ static inline void apply_alternatives_module(void *start, size_t length) { } + ".pushsection .altinstructions,\"a\"\n" \ + ALTINSTR_ENTRY(feature) \ + ".popsection\n" \ +- ".pushsection .altinstr_replacement, \"a\"\n" \ ++ ".subsection 1\n" \ + "663:\n\t" \ + newinstr "\n" \ + "664:\n\t" \ +- ".popsection\n\t" \ ++ ".previous\n\t" \ + ".org . - (664b-663b) + (662b-661b)\n\t" \ + ".org . - (662b-661b) + (664b-663b)\n" \ + ".endif\n" +@@ -117,9 +117,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } + 662: .pushsection .altinstructions, "a" + altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f + .popsection +- .pushsection .altinstr_replacement, "ax" ++ .subsection 1 + 663: \insn2 +-664: .popsection ++664: .previous + .org . - (664b-663b) + (662b-661b) + .org . - (662b-661b) + (664b-663b) + .endif +@@ -160,7 +160,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { } + .pushsection .altinstructions, "a" + altinstruction_entry 663f, 661f, \cap, 664f-663f, 662f-661f + .popsection +- .pushsection .altinstr_replacement, "ax" ++ .subsection 1 + .align 2 /* So GAS knows label 661 is suitably aligned */ + 661: + .endm +@@ -179,9 +179,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } + .macro alternative_else + 662: + .if .Lasm_alt_mode==0 +- .pushsection .altinstr_replacement, "ax" ++ .subsection 1 + .else +- .popsection ++ .previous + .endif + 663: + .endm +@@ -192,7 +192,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { } + .macro alternative_endif + 664: + .if .Lasm_alt_mode==0 +- .popsection ++ .previous + .endif + .org . - (664b-663b) + (662b-661b) + .org . - (662b-661b) + (664b-663b) +diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S +index 94402aaf5f5c7..9869412ac156d 100644 +--- a/arch/arm64/kernel/vmlinux.lds.S ++++ b/arch/arm64/kernel/vmlinux.lds.S +@@ -172,9 +172,6 @@ SECTIONS + *(.altinstructions) + __alt_instructions_end = .; + } +- .altinstr_replacement : { +- *(.altinstr_replacement) +- } + + . = ALIGN(PAGE_SIZE); + __inittext_end = .; +-- +2.25.1 + diff --git a/queue-5.7/blk-mq-debugfs-update-blk_queue_flag_name-accordingl.patch b/queue-5.7/blk-mq-debugfs-update-blk_queue_flag_name-accordingl.patch new file mode 100644 index 00000000000..d523deec69a --- /dev/null +++ b/queue-5.7/blk-mq-debugfs-update-blk_queue_flag_name-accordingl.patch @@ -0,0 +1,50 @@ +From 07d129416c120524227636e8ccdb7a965ca01816 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 28 Apr 2020 09:54:56 +0800 +Subject: blk-mq-debugfs: update blk_queue_flag_name[] accordingly for new + flags + +From: Hou Tao + +[ Upstream commit bfe373f608cf81b7626dfeb904001b0e867c5110 ] + +Else there may be magic numbers in /sys/kernel/debug/block/*/state. + +Signed-off-by: Hou Tao +Reviewed-by: Bart Van Assche +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + block/blk-mq-debugfs.c | 3 +++ + include/linux/blkdev.h | 1 + + 2 files changed, 4 insertions(+) + +diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c +index b3f2ba483992d..121f4c1e0697b 100644 +--- a/block/blk-mq-debugfs.c ++++ b/block/blk-mq-debugfs.c +@@ -125,6 +125,9 @@ static const char *const blk_queue_flag_name[] = { + QUEUE_FLAG_NAME(REGISTERED), + QUEUE_FLAG_NAME(SCSI_PASSTHROUGH), + QUEUE_FLAG_NAME(QUIESCED), ++ QUEUE_FLAG_NAME(PCI_P2PDMA), ++ QUEUE_FLAG_NAME(ZONE_RESETALL), ++ QUEUE_FLAG_NAME(RQ_ALLOC_TIME), + }; + #undef QUEUE_FLAG_NAME + +diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h +index 32868fbedc9e9..02809e4dd661e 100644 +--- a/include/linux/blkdev.h ++++ b/include/linux/blkdev.h +@@ -585,6 +585,7 @@ struct request_queue { + u64 write_hints[BLK_MAX_WRITE_HINTS]; + }; + ++/* Keep blk_queue_flag_name[] in sync with the definitions below */ + #define QUEUE_FLAG_STOPPED 0 /* queue is stopped */ + #define QUEUE_FLAG_DYING 1 /* queue being torn down */ + #define QUEUE_FLAG_NOMERGES 3 /* disable merge attempts */ +-- +2.25.1 + diff --git a/queue-5.7/cifs-prevent-truncation-from-long-to-int-in-wait_for.patch b/queue-5.7/cifs-prevent-truncation-from-long-to-int-in-wait_for.patch new file mode 100644 index 00000000000..bc3ae55ca2d --- /dev/null +++ b/queue-5.7/cifs-prevent-truncation-from-long-to-int-in-wait_for.patch @@ -0,0 +1,36 @@ +From effbfed7ceb2209265a4b319a973615ea3220e21 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 2 Jul 2020 10:55:41 +1000 +Subject: cifs: prevent truncation from long to int in wait_for_free_credits + +From: Ronnie Sahlberg + +[ Upstream commit 19e888678bac8c82206eb915eaf72741b2a2615c ] + +The wait_event_... defines evaluate to long so we should not assign it an int as this may truncate +the value. + +Reported-by: Marshall Midden +Signed-off-by: Ronnie Sahlberg +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/cifs/transport.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c +index c97570eb2c180..7fefd2bd111c4 100644 +--- a/fs/cifs/transport.c ++++ b/fs/cifs/transport.c +@@ -528,7 +528,7 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int num_credits, + const int timeout, const int flags, + unsigned int *instance) + { +- int rc; ++ long rc; + int *credits; + int optype; + long int t; +-- +2.25.1 + diff --git a/queue-5.7/drm-exynos-fix-ref-count-leak-in-mic_pre_enable.patch b/queue-5.7/drm-exynos-fix-ref-count-leak-in-mic_pre_enable.patch new file mode 100644 index 00000000000..9443639dab5 --- /dev/null +++ b/queue-5.7/drm-exynos-fix-ref-count-leak-in-mic_pre_enable.patch @@ -0,0 +1,39 @@ +From 27745c7d5f94ac139017ff50b87ebf6c4a51d07e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 Jun 2020 00:49:28 -0500 +Subject: drm/exynos: fix ref count leak in mic_pre_enable + +From: Navid Emamdoost + +[ Upstream commit d4f5a095daf0d25f0b385e1ef26338608433a4c5 ] + +in mic_pre_enable, pm_runtime_get_sync is called which +increments the counter even in case of failure, leading to incorrect +ref count. In case of failure, decrement the ref count before returning. + +Signed-off-by: Navid Emamdoost +Signed-off-by: Inki Dae +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c +index f41d75923557a..004110c5ded42 100644 +--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c ++++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c +@@ -269,8 +269,10 @@ static void mic_pre_enable(struct drm_bridge *bridge) + goto unlock; + + ret = pm_runtime_get_sync(mic->dev); +- if (ret < 0) ++ if (ret < 0) { ++ pm_runtime_put_noidle(mic->dev); + goto unlock; ++ } + + mic_set_path(mic, 1); + +-- +2.25.1 + diff --git a/queue-5.7/drm-exynos-properly-propagate-return-value-in-drm_io.patch b/queue-5.7/drm-exynos-properly-propagate-return-value-in-drm_io.patch new file mode 100644 index 00000000000..e6253c93623 --- /dev/null +++ b/queue-5.7/drm-exynos-properly-propagate-return-value-in-drm_io.patch @@ -0,0 +1,47 @@ +From 540a4d3bf55b60d1f1673503a4ca63eae83b2d28 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 1 Jun 2020 17:06:30 +0900 +Subject: drm/exynos: Properly propagate return value in + drm_iommu_attach_device() + +From: Marek Szyprowski + +[ Upstream commit b9c633882de4601015625f9136f248e9abca8a7a ] + +Propagate the proper error codes from the called functions instead of +unconditionally returning 0. + +Reported-by: kbuild test robot +Signed-off-by: Marek Szyprowski +Merge conflict so merged it manually. +Signed-off-by: Inki Dae +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/exynos/exynos_drm_dma.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c b/drivers/gpu/drm/exynos/exynos_drm_dma.c +index 619f81435c1b2..58b89ec11b0eb 100644 +--- a/drivers/gpu/drm/exynos/exynos_drm_dma.c ++++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c +@@ -61,7 +61,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev, + struct device *subdrv_dev, void **dma_priv) + { + struct exynos_drm_private *priv = drm_dev->dev_private; +- int ret; ++ int ret = 0; + + if (get_dma_ops(priv->dma_dev) != get_dma_ops(subdrv_dev)) { + DRM_DEV_ERROR(subdrv_dev, "Device %s lacks support for IOMMU\n", +@@ -92,7 +92,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev, + if (ret) + clear_dma_max_seg_size(subdrv_dev); + +- return 0; ++ return ret; + } + + /* +-- +2.25.1 + diff --git a/queue-5.7/drm-msm-dpu-allow-initialization-of-encoder-locks-du.patch b/queue-5.7/drm-msm-dpu-allow-initialization-of-encoder-locks-du.patch new file mode 100644 index 00000000000..976529f5414 --- /dev/null +++ b/queue-5.7/drm-msm-dpu-allow-initialization-of-encoder-locks-du.patch @@ -0,0 +1,55 @@ +From c984a32d9d03130a173960ad7204096782c90b32 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 28 May 2020 14:04:28 +0530 +Subject: drm/msm/dpu: allow initialization of encoder locks during encoder + init + +From: Krishna Manikandan + +[ Upstream commit 2e7ec6b5297157efabb50e5f82adc628cf90296c ] + +In the current implementation, mutex initialization +for encoder mutex locks are done during encoder +setup. This can lead to scenarios where the lock +is used before it is initialized. Move mutex_init +to dpu_encoder_init to avoid this. + +Signed-off-by: Krishna Manikandan +Signed-off-by: Rob Clark +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +index a2f6b688a9768..932dd8c3c4118 100644 +--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c ++++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +@@ -2126,7 +2126,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, + + dpu_enc = to_dpu_encoder_virt(enc); + +- mutex_init(&dpu_enc->enc_lock); + ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info); + if (ret) + goto fail; +@@ -2141,7 +2140,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, + 0); + + +- mutex_init(&dpu_enc->rc_lock); + INIT_DELAYED_WORK(&dpu_enc->delayed_off_work, + dpu_encoder_off_work); + dpu_enc->idle_timeout = IDLE_TIMEOUT; +@@ -2186,6 +2184,8 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev, + + spin_lock_init(&dpu_enc->enc_spinlock); + dpu_enc->enabled = false; ++ mutex_init(&dpu_enc->enc_lock); ++ mutex_init(&dpu_enc->rc_lock); + + return &dpu_enc->base; + } +-- +2.25.1 + diff --git a/queue-5.7/drm-msm-fix-potential-memleak-in-error-branch.patch b/queue-5.7/drm-msm-fix-potential-memleak-in-error-branch.patch new file mode 100644 index 00000000000..a830e5cd65d --- /dev/null +++ b/queue-5.7/drm-msm-fix-potential-memleak-in-error-branch.patch @@ -0,0 +1,41 @@ +From e1b1e5d1da0e98e154c3c5fbd23bcd2e77a4acb8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 12 Jun 2020 09:23:49 +0800 +Subject: drm/msm: fix potential memleak in error branch + +From: Bernard Zhao + +[ Upstream commit 177d3819633cd520e3f95df541a04644aab4c657 ] + +In function msm_submitqueue_create, the queue is a local +variable, in return -EINVAL branch, queue didn`t add to ctx`s +list yet, and also didn`t kfree, this maybe bring in potential +memleak. + +Signed-off-by: Bernard Zhao +[trivial commit msg fixup] +Signed-off-by: Rob Clark +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/msm/msm_submitqueue.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/msm/msm_submitqueue.c b/drivers/gpu/drm/msm/msm_submitqueue.c +index 001fbf537440a..a1d94be7883a0 100644 +--- a/drivers/gpu/drm/msm/msm_submitqueue.c ++++ b/drivers/gpu/drm/msm/msm_submitqueue.c +@@ -71,8 +71,10 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx, + queue->flags = flags; + + if (priv->gpu) { +- if (prio >= priv->gpu->nr_rings) ++ if (prio >= priv->gpu->nr_rings) { ++ kfree(queue); + return -EINVAL; ++ } + + queue->prio = prio; + } +-- +2.25.1 + diff --git a/queue-5.7/dt-bindings-bus-uniphier-system-bus-fix-warning-in-e.patch b/queue-5.7/dt-bindings-bus-uniphier-system-bus-fix-warning-in-e.patch new file mode 100644 index 00000000000..38b86959333 --- /dev/null +++ b/queue-5.7/dt-bindings-bus-uniphier-system-bus-fix-warning-in-e.patch @@ -0,0 +1,53 @@ +From e63bf0f481c7219a5672f620cdcba9cfa450cc64 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 Jun 2020 20:32:42 +0900 +Subject: dt-bindings: bus: uniphier-system-bus: fix warning in example + +From: Masahiro Yamada + +[ Upstream commit 0fb24d1e5a6cf3b7ca0df325fbfb10895df41bec ] + +Since commit e69f5dc623f9 ("dt-bindings: serial: Convert 8250 to +json-schema"), the schema for "ns16550a" is checked. + +'make dt_binding_check' emits the following warning: + + uart@5,00200000: $nodename:0: 'uart@5,00200000' does not match '^serial(@[0-9a-f,]+)*$' + +Rename the node to follow the pattern defined in +Documentation/devicetree/bindings/serial/serial.yaml + +While I was here, I removed leading zeros from unit names. + +Signed-off-by: Masahiro Yamada +Link: https://lore.kernel.org/r/20200623113242.779241-1-yamada.masahiro@socionext.com +Signed-off-by: Rob Herring +Signed-off-by: Sasha Levin +--- + .../bindings/bus/socionext,uniphier-system-bus.yaml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Documentation/devicetree/bindings/bus/socionext,uniphier-system-bus.yaml b/Documentation/devicetree/bindings/bus/socionext,uniphier-system-bus.yaml +index c4c9119e4a206..a0c6c5d2b70fb 100644 +--- a/Documentation/devicetree/bindings/bus/socionext,uniphier-system-bus.yaml ++++ b/Documentation/devicetree/bindings/bus/socionext,uniphier-system-bus.yaml +@@ -80,14 +80,14 @@ examples: + ranges = <1 0x00000000 0x42000000 0x02000000>, + <5 0x00000000 0x46000000 0x01000000>; + +- ethernet@1,01f00000 { ++ ethernet@1,1f00000 { + compatible = "smsc,lan9115"; + reg = <1 0x01f00000 0x1000>; + interrupts = <0 48 4>; + phy-mode = "mii"; + }; + +- uart@5,00200000 { ++ serial@5,200000 { + compatible = "ns16550a"; + reg = <5 0x00200000 0x20>; + interrupts = <0 49 4>; +-- +2.25.1 + diff --git a/queue-5.7/dt-bindings-fix-error-in-make-clean-after-make-dt_bi.patch b/queue-5.7/dt-bindings-fix-error-in-make-clean-after-make-dt_bi.patch new file mode 100644 index 00000000000..2e174ed5e4d --- /dev/null +++ b/queue-5.7/dt-bindings-fix-error-in-make-clean-after-make-dt_bi.patch @@ -0,0 +1,55 @@ +From 33e74f68596baa4335b22d6585f67d7cf9a3f97a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 26 Jun 2020 02:04:31 +0900 +Subject: dt-bindings: fix error in 'make clean' after 'make dt_binding_check' + +From: Masahiro Yamada + +[ Upstream commit fa714cf58c7c09a454ff9fda2ee8318591128eb6 ] + +We are having more and more schema files. + +Commit 8b6b80218b01 ("dt-bindings: Fix command line length limit +calling dt-mk-schema") fixed the 'Argument list too long' error of +the schema checks, but the same error happens while cleaning too. + +'make clean' after 'make dt_binding_check' fails as follows: + + $ make dt_binding_check + [ snip ] + $ make clean + make[2]: execvp: /bin/sh: Argument list too long + make[2]: *** [scripts/Makefile.clean:52: __clean] Error 127 + make[1]: *** [scripts/Makefile.clean:66: Documentation/devicetree/bindings] Error 2 + make: *** [Makefile:1763: _clean_Documentation] Error 2 + +'make dt_binding_check' generates so many .example.dts, .dt.yaml files, +which are passed to the 'rm' command when you run 'make clean'. + +I added a small hack to use the 'find' command to clean up most of the +build artifacts before they are processed by scripts/Makefile.clean + +Signed-off-by: Masahiro Yamada +Link: https://lore.kernel.org/r/20200625170434.635114-2-masahiroy@kernel.org +Signed-off-by: Rob Herring +Signed-off-by: Sasha Levin +--- + Documentation/devicetree/bindings/Makefile | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile +index 7782d99850823..b03d58c6b072f 100644 +--- a/Documentation/devicetree/bindings/Makefile ++++ b/Documentation/devicetree/bindings/Makefile +@@ -45,3 +45,8 @@ $(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) FORCE + $(call if_changed,mk_schema) + + extra-y += processed-schema.yaml ++ ++# Hack: avoid 'Argument list too long' error for 'make clean'. Remove most of ++# build artifacts here before they are processed by scripts/Makefile.clean ++clean-files = $(shell find $(obj) \( -name '*.example.dts' -o \ ++ -name '*.example.dt.yaml' \) -delete 2>/dev/null) +-- +2.25.1 + diff --git a/queue-5.7/dt-bindings-mailbox-zynqmp_ipi-fix-unit-address.patch b/queue-5.7/dt-bindings-mailbox-zynqmp_ipi-fix-unit-address.patch new file mode 100644 index 00000000000..0f64df41d01 --- /dev/null +++ b/queue-5.7/dt-bindings-mailbox-zynqmp_ipi-fix-unit-address.patch @@ -0,0 +1,36 @@ +From e510339e21e9772861de0a3e86b168c366fb6e44 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Jun 2020 22:51:58 +0900 +Subject: dt-bindings: mailbox: zynqmp_ipi: fix unit address + +From: Kangmin Park + +[ Upstream commit 35b9c0fdb9f666628ecda02b1fc44306933a2d97 ] + +Fix unit address to match the first address specified in the reg +property of the node in example. + +Signed-off-by: Kangmin Park +Link: https://lore.kernel.org/r/20200625135158.5861-1-l4stpr0gr4m@gmail.com +Signed-off-by: Rob Herring +Signed-off-by: Sasha Levin +--- + .../devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt +index 4438432bfe9b3..ad76edccf8816 100644 +--- a/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt ++++ b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt +@@ -87,7 +87,7 @@ Example: + ranges; + + /* APU<->RPU0 IPI mailbox controller */ +- ipi_mailbox_rpu0: mailbox@ff90400 { ++ ipi_mailbox_rpu0: mailbox@ff990400 { + reg = <0xff990400 0x20>, + <0xff990420 0x20>, + <0xff990080 0x20>, +-- +2.25.1 + diff --git a/queue-5.7/gfs2-eliminate-gif_ordered-in-favor-of-list_empty.patch b/queue-5.7/gfs2-eliminate-gif_ordered-in-favor-of-list_empty.patch new file mode 100644 index 00000000000..95bb5713c83 --- /dev/null +++ b/queue-5.7/gfs2-eliminate-gif_ordered-in-favor-of-list_empty.patch @@ -0,0 +1,117 @@ +From 85db39e2310cf98e6be9493c757606e408fdb4b9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 Jun 2020 07:47:34 -0500 +Subject: gfs2: eliminate GIF_ORDERED in favor of list_empty + +From: Bob Peterson + +[ Upstream commit 7542486b89b2e321ffe0de82163b425d6a38bc72 ] + +In several places, we used the GIF_ORDERED inode flag to determine +if an inode was on the ordered writes list. However, since we always +held the sd_ordered_lock spin_lock during the manipulation, we can +just as easily check list_empty(&ip->i_ordered) instead. +This allows us to keep more than one ordered writes list to make +journal writing improvements. + +This patch eliminates GIF_ORDERED in favor of checking list_empty. + +Signed-off-by: Bob Peterson +Signed-off-by: Sasha Levin +--- + fs/gfs2/incore.h | 1 - + fs/gfs2/log.c | 15 +++++++++------ + fs/gfs2/log.h | 4 ++-- + fs/gfs2/main.c | 1 + + 4 files changed, 12 insertions(+), 9 deletions(-) + +diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h +index 84a824293a78b..013c029dd16b8 100644 +--- a/fs/gfs2/incore.h ++++ b/fs/gfs2/incore.h +@@ -395,7 +395,6 @@ enum { + GIF_QD_LOCKED = 1, + GIF_ALLOC_FAILED = 2, + GIF_SW_PAGED = 3, +- GIF_ORDERED = 4, + GIF_FREE_VFS_INODE = 5, + GIF_GLOP_PENDING = 6, + }; +diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c +index 04882712cd661..62a73bd6575cb 100644 +--- a/fs/gfs2/log.c ++++ b/fs/gfs2/log.c +@@ -613,6 +613,12 @@ static int ip_cmp(void *priv, struct list_head *a, struct list_head *b) + return 0; + } + ++static void __ordered_del_inode(struct gfs2_inode *ip) ++{ ++ if (!list_empty(&ip->i_ordered)) ++ list_del_init(&ip->i_ordered); ++} ++ + static void gfs2_ordered_write(struct gfs2_sbd *sdp) + { + struct gfs2_inode *ip; +@@ -623,8 +629,7 @@ static void gfs2_ordered_write(struct gfs2_sbd *sdp) + while (!list_empty(&sdp->sd_log_ordered)) { + ip = list_first_entry(&sdp->sd_log_ordered, struct gfs2_inode, i_ordered); + if (ip->i_inode.i_mapping->nrpages == 0) { +- test_and_clear_bit(GIF_ORDERED, &ip->i_flags); +- list_del(&ip->i_ordered); ++ __ordered_del_inode(ip); + continue; + } + list_move(&ip->i_ordered, &written); +@@ -643,8 +648,7 @@ static void gfs2_ordered_wait(struct gfs2_sbd *sdp) + spin_lock(&sdp->sd_ordered_lock); + while (!list_empty(&sdp->sd_log_ordered)) { + ip = list_first_entry(&sdp->sd_log_ordered, struct gfs2_inode, i_ordered); +- list_del(&ip->i_ordered); +- WARN_ON(!test_and_clear_bit(GIF_ORDERED, &ip->i_flags)); ++ __ordered_del_inode(ip); + if (ip->i_inode.i_mapping->nrpages == 0) + continue; + spin_unlock(&sdp->sd_ordered_lock); +@@ -659,8 +663,7 @@ void gfs2_ordered_del_inode(struct gfs2_inode *ip) + struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); + + spin_lock(&sdp->sd_ordered_lock); +- if (test_and_clear_bit(GIF_ORDERED, &ip->i_flags)) +- list_del(&ip->i_ordered); ++ __ordered_del_inode(ip); + spin_unlock(&sdp->sd_ordered_lock); + } + +diff --git a/fs/gfs2/log.h b/fs/gfs2/log.h +index c1cd6ae176597..8965c751a3039 100644 +--- a/fs/gfs2/log.h ++++ b/fs/gfs2/log.h +@@ -53,9 +53,9 @@ static inline void gfs2_ordered_add_inode(struct gfs2_inode *ip) + if (gfs2_is_jdata(ip) || !gfs2_is_ordered(sdp)) + return; + +- if (!test_bit(GIF_ORDERED, &ip->i_flags)) { ++ if (list_empty(&ip->i_ordered)) { + spin_lock(&sdp->sd_ordered_lock); +- if (!test_and_set_bit(GIF_ORDERED, &ip->i_flags)) ++ if (list_empty(&ip->i_ordered)) + list_add(&ip->i_ordered, &sdp->sd_log_ordered); + spin_unlock(&sdp->sd_ordered_lock); + } +diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c +index a1a295b739fb8..4f2edb777a721 100644 +--- a/fs/gfs2/main.c ++++ b/fs/gfs2/main.c +@@ -39,6 +39,7 @@ static void gfs2_init_inode_once(void *foo) + atomic_set(&ip->i_sizehint, 0); + init_rwsem(&ip->i_rw_mutex); + INIT_LIST_HEAD(&ip->i_trunc_list); ++ INIT_LIST_HEAD(&ip->i_ordered); + ip->i_qadata = NULL; + gfs2_holder_mark_uninitialized(&ip->i_rgd_gh); + memset(&ip->i_res, 0, sizeof(ip->i_res)); +-- +2.25.1 + diff --git a/queue-5.7/gfs2-freeze-should-work-on-read-only-mounts.patch b/queue-5.7/gfs2-freeze-should-work-on-read-only-mounts.patch new file mode 100644 index 00000000000..ec09e6e8ada --- /dev/null +++ b/queue-5.7/gfs2-freeze-should-work-on-read-only-mounts.patch @@ -0,0 +1,54 @@ +From 3d6bc144d6f997c55bbb08814a6736c60ab45829 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Jun 2020 13:29:44 -0500 +Subject: gfs2: freeze should work on read-only mounts + +From: Bob Peterson + +[ Upstream commit 541656d3a5136ae830d604e237f29f406d42c592 ] + +Before this patch, function freeze_go_sync, called when promoting +the freeze glock, was testing for the SDF_JOURNAL_LIVE superblock flag. +That's only set for read-write mounts. Read-only mounts don't use a +journal, so the bit is never set, so the freeze never happened. + +This patch removes the check for SDF_JOURNAL_LIVE for freeze requests +but still checks it when deciding whether to flush a journal. + +Signed-off-by: Bob Peterson +Signed-off-by: Sasha Levin +--- + fs/gfs2/glops.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c +index 9e9c7a4b8c663..fc97c4d24dc58 100644 +--- a/fs/gfs2/glops.c ++++ b/fs/gfs2/glops.c +@@ -527,8 +527,7 @@ static int freeze_go_sync(struct gfs2_glock *gl) + int error = 0; + struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; + +- if (gl->gl_state == LM_ST_SHARED && !gfs2_withdrawn(sdp) && +- test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) { ++ if (gl->gl_req == LM_ST_EXCLUSIVE && !gfs2_withdrawn(sdp)) { + atomic_set(&sdp->sd_freeze_state, SFS_STARTING_FREEZE); + error = freeze_super(sdp->sd_vfs); + if (error) { +@@ -541,8 +540,11 @@ static int freeze_go_sync(struct gfs2_glock *gl) + gfs2_assert_withdraw(sdp, 0); + } + queue_work(gfs2_freeze_wq, &sdp->sd_freeze_work); +- gfs2_log_flush(sdp, NULL, GFS2_LOG_HEAD_FLUSH_FREEZE | +- GFS2_LFC_FREEZE_GO_SYNC); ++ if (test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) ++ gfs2_log_flush(sdp, NULL, GFS2_LOG_HEAD_FLUSH_FREEZE | ++ GFS2_LFC_FREEZE_GO_SYNC); ++ else /* read-only mounts */ ++ atomic_set(&sdp->sd_freeze_state, SFS_FROZEN); + } + return 0; + } +-- +2.25.1 + diff --git a/queue-5.7/gfs2-read-only-mounts-should-grab-the-sd_freeze_gl-g.patch b/queue-5.7/gfs2-read-only-mounts-should-grab-the-sd_freeze_gl-g.patch new file mode 100644 index 00000000000..15c107028db --- /dev/null +++ b/queue-5.7/gfs2-read-only-mounts-should-grab-the-sd_freeze_gl-g.patch @@ -0,0 +1,51 @@ +From c8d9b05719728daaf0077035b7c8fabdb817fab8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Jun 2020 13:30:18 -0500 +Subject: gfs2: read-only mounts should grab the sd_freeze_gl glock + +From: Bob Peterson + +[ Upstream commit b780cc615ba4795a7ef0e93b19424828a5ad456a ] + +Before this patch, only read-write mounts would grab the freeze +glock in read-only mode, as part of gfs2_make_fs_rw. So the freeze +glock was never initialized. That meant requests to freeze, which +request the glock in EX, were granted without any state transition. +That meant you could mount a gfs2 file system, which is currently +frozen on a different cluster node, in read-only mode. + +This patch makes read-only mounts lock the freeze glock in SH mode, +which will block for file systems that are frozen on another node. + +Signed-off-by: Bob Peterson +Signed-off-by: Sasha Levin +--- + fs/gfs2/ops_fstype.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c +index 094f5fe7c0090..a2c0554a18901 100644 +--- a/fs/gfs2/ops_fstype.c ++++ b/fs/gfs2/ops_fstype.c +@@ -1136,7 +1136,17 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) + goto fail_per_node; + } + +- if (!sb_rdonly(sb)) { ++ if (sb_rdonly(sb)) { ++ struct gfs2_holder freeze_gh; ++ ++ error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, ++ GL_EXACT, &freeze_gh); ++ if (error) { ++ fs_err(sdp, "can't make FS RO: %d\n", error); ++ goto fail_per_node; ++ } ++ gfs2_glock_dq_uninit(&freeze_gh); ++ } else { + error = gfs2_make_fs_rw(sdp); + if (error) { + fs_err(sdp, "can't make FS RW: %d\n", error); +-- +2.25.1 + diff --git a/queue-5.7/gfs2-the-freeze-glock-should-never-be-frozen.patch b/queue-5.7/gfs2-the-freeze-glock-should-never-be-frozen.patch new file mode 100644 index 00000000000..a3d0aa93230 --- /dev/null +++ b/queue-5.7/gfs2-the-freeze-glock-should-never-be-frozen.patch @@ -0,0 +1,90 @@ +From d6ca32c649625ff5d67da1be160489cfc787eeba Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Jun 2020 14:42:17 -0500 +Subject: gfs2: The freeze glock should never be frozen + +From: Bob Peterson + +[ Upstream commit c860f8ffbea8924de05a281b937128773d30a77c ] + +Before this patch, some gfs2 code locked the freeze glock with LM_FLAG_NOEXP +(Do not freeze) flag, and some did not. We never want to freeze the freeze +glock, so this patch makes it consistently use LM_FLAG_NOEXP always. + +Signed-off-by: Bob Peterson +Signed-off-by: Sasha Levin +--- + fs/gfs2/ops_fstype.c | 3 ++- + fs/gfs2/super.c | 16 +++++++++------- + 2 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c +index a2c0554a18901..6d18d2c91add2 100644 +--- a/fs/gfs2/ops_fstype.c ++++ b/fs/gfs2/ops_fstype.c +@@ -1140,7 +1140,8 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) + struct gfs2_holder freeze_gh; + + error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, +- GL_EXACT, &freeze_gh); ++ LM_FLAG_NOEXP | GL_EXACT, ++ &freeze_gh); + if (error) { + fs_err(sdp, "can't make FS RO: %d\n", error); + goto fail_per_node; +diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c +index 3bc76cf382fb9..160bb4598b48b 100644 +--- a/fs/gfs2/super.c ++++ b/fs/gfs2/super.c +@@ -167,7 +167,8 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp) + if (error) + return error; + +- error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, GL_EXACT, ++ error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, ++ LM_FLAG_NOEXP | GL_EXACT, + &freeze_gh); + if (error) + goto fail_threads; +@@ -429,7 +430,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp) + } + + error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_EXCLUSIVE, +- 0, &sdp->sd_freeze_gh); ++ LM_FLAG_NOEXP, &sdp->sd_freeze_gh); + if (error) + goto out; + +@@ -612,14 +613,15 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp) + !gfs2_glock_is_locked_by_me(sdp->sd_freeze_gl)) { + if (!log_write_allowed) { + error = gfs2_glock_nq_init(sdp->sd_freeze_gl, +- LM_ST_SHARED, +- LM_FLAG_TRY | GL_EXACT, ++ LM_ST_SHARED, LM_FLAG_TRY | ++ LM_FLAG_NOEXP | GL_EXACT, + &freeze_gh); + if (error == GLR_TRYFAILED) + error = 0; + } else { + error = gfs2_glock_nq_init(sdp->sd_freeze_gl, +- LM_ST_SHARED, GL_EXACT, ++ LM_ST_SHARED, ++ LM_FLAG_NOEXP | GL_EXACT, + &freeze_gh); + if (error && !gfs2_withdrawn(sdp)) + return error; +@@ -761,8 +763,8 @@ void gfs2_freeze_func(struct work_struct *work) + struct super_block *sb = sdp->sd_vfs; + + atomic_inc(&sb->s_active); +- error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, GL_EXACT, +- &freeze_gh); ++ error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, ++ LM_FLAG_NOEXP | GL_EXACT, &freeze_gh); + if (error) { + fs_info(sdp, "GFS2: couldn't get freeze lock : %d\n", error); + gfs2_assert_withdraw(sdp, 0); +-- +2.25.1 + diff --git a/queue-5.7/gfs2-when-freezing-gfs2-use-gl_exact-and-not-gl_noca.patch b/queue-5.7/gfs2-when-freezing-gfs2-use-gl_exact-and-not-gl_noca.patch new file mode 100644 index 00000000000..fc1181d39fb --- /dev/null +++ b/queue-5.7/gfs2-when-freezing-gfs2-use-gl_exact-and-not-gl_noca.patch @@ -0,0 +1,116 @@ +From dafe212a7057c72613e0a241f4dbb2508d55f27c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Jun 2020 13:30:52 -0500 +Subject: gfs2: When freezing gfs2, use GL_EXACT and not GL_NOCACHE + +From: Bob Peterson + +[ Upstream commit 623ba664b74a20f22a2ef7ebd71e171d2d7c626f ] + +Before this patch, the freeze code in gfs2 specified GL_NOCACHE in +several places. That's wrong because we always want to know the state +of whether the file system is frozen. + +There was also a problem with freeze/thaw transitioning the glock from +frozen (EX) to thawed (SH) because gfs2 will normally grant glocks in EX +to processes that request it in SH mode, unless GL_EXACT is specified. +Therefore, the freeze/thaw code, which tried to reacquire the glock in +SH mode would get the glock in EX mode, and miss the transition from EX +to SH. That made it think the thaw had completed normally, but since the +glock was still cached in EX, other nodes could not freeze again. + +This patch removes the GL_NOCACHE flag to allow the freeze glock to be +cached. It also adds the GL_EXACT flag so the glock is fully transitioned +from EX to SH, thereby allowing future freeze operations. + +Signed-off-by: Bob Peterson +Signed-off-by: Sasha Levin +--- + fs/gfs2/recovery.c | 4 ++-- + fs/gfs2/super.c | 16 +++++++--------- + 2 files changed, 9 insertions(+), 11 deletions(-) + +diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c +index 96c345f492738..390ea79d682c2 100644 +--- a/fs/gfs2/recovery.c ++++ b/fs/gfs2/recovery.c +@@ -364,8 +364,8 @@ void gfs2_recover_func(struct work_struct *work) + /* Acquire a shared hold on the freeze lock */ + + error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, +- LM_FLAG_NOEXP | LM_FLAG_PRIORITY, +- &thaw_gh); ++ LM_FLAG_NOEXP | LM_FLAG_PRIORITY | ++ GL_EXACT, &thaw_gh); + if (error) + goto fail_gunlock_ji; + +diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c +index 956fced0a8ec2..3bc76cf382fb9 100644 +--- a/fs/gfs2/super.c ++++ b/fs/gfs2/super.c +@@ -167,7 +167,7 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp) + if (error) + return error; + +- error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, 0, ++ error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, GL_EXACT, + &freeze_gh); + if (error) + goto fail_threads; +@@ -203,7 +203,6 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp) + return 0; + + fail: +- freeze_gh.gh_flags |= GL_NOCACHE; + gfs2_glock_dq_uninit(&freeze_gh); + fail_threads: + if (sdp->sd_quotad_process) +@@ -430,7 +429,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp) + } + + error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_EXCLUSIVE, +- GL_NOCACHE, &sdp->sd_freeze_gh); ++ 0, &sdp->sd_freeze_gh); + if (error) + goto out; + +@@ -613,13 +612,14 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp) + !gfs2_glock_is_locked_by_me(sdp->sd_freeze_gl)) { + if (!log_write_allowed) { + error = gfs2_glock_nq_init(sdp->sd_freeze_gl, +- LM_ST_SHARED, GL_NOCACHE | +- LM_FLAG_TRY, &freeze_gh); ++ LM_ST_SHARED, ++ LM_FLAG_TRY | GL_EXACT, ++ &freeze_gh); + if (error == GLR_TRYFAILED) + error = 0; + } else { + error = gfs2_glock_nq_init(sdp->sd_freeze_gl, +- LM_ST_SHARED, GL_NOCACHE, ++ LM_ST_SHARED, GL_EXACT, + &freeze_gh); + if (error && !gfs2_withdrawn(sdp)) + return error; +@@ -761,7 +761,7 @@ void gfs2_freeze_func(struct work_struct *work) + struct super_block *sb = sdp->sd_vfs; + + atomic_inc(&sb->s_active); +- error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, 0, ++ error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, GL_EXACT, + &freeze_gh); + if (error) { + fs_info(sdp, "GFS2: couldn't get freeze lock : %d\n", error); +@@ -774,8 +774,6 @@ void gfs2_freeze_func(struct work_struct *work) + error); + gfs2_assert_withdraw(sdp, 0); + } +- if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) +- freeze_gh.gh_flags |= GL_NOCACHE; + gfs2_glock_dq_uninit(&freeze_gh); + } + deactivate_super(sb); +-- +2.25.1 + diff --git a/queue-5.7/i2c-eg20t-load-module-automatically-if-id-matches.patch b/queue-5.7/i2c-eg20t-load-module-automatically-if-id-matches.patch new file mode 100644 index 00000000000..977ae4def19 --- /dev/null +++ b/queue-5.7/i2c-eg20t-load-module-automatically-if-id-matches.patch @@ -0,0 +1,35 @@ +From 9fdddbbfc1d65d770e32c7c76cd3b9b2c8b4d6fc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 2 Jul 2020 13:15:27 +0300 +Subject: i2c: eg20t: Load module automatically if ID matches + +From: Andy Shevchenko + +[ Upstream commit 5f90786b31fb7d1e199a8999d46c4e3aea672e11 ] + +The driver can't be loaded automatically because it misses +module alias to be provided. Add corresponding MODULE_DEVICE_TABLE() +call to the driver. + +Signed-off-by: Andy Shevchenko +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-eg20t.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c +index bb810dee8fb5e..73f139690e4e5 100644 +--- a/drivers/i2c/busses/i2c-eg20t.c ++++ b/drivers/i2c/busses/i2c-eg20t.c +@@ -180,6 +180,7 @@ static const struct pci_device_id pch_pcidev_id[] = { + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_I2C), 1, }, + {0,} + }; ++MODULE_DEVICE_TABLE(pci, pch_pcidev_id); + + static irqreturn_t pch_i2c_handler(int irq, void *pData); + +-- +2.25.1 + diff --git a/queue-5.7/m68k-mm-fix-node-memblock-init.patch b/queue-5.7/m68k-mm-fix-node-memblock-init.patch new file mode 100644 index 00000000000..83117b90994 --- /dev/null +++ b/queue-5.7/m68k-mm-fix-node-memblock-init.patch @@ -0,0 +1,39 @@ +From 57e33dd986ed18762f523998e4be92247062975c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 Jun 2020 09:53:41 +0300 +Subject: m68k: mm: fix node memblock init + +From: Angelo Dureghello + +[ Upstream commit c43e55796dd4d13f4855971a4d7970ce2cd94db4 ] + +After pulling 5.7.0 (linux-next merge), mcf5441x mmu boot was +hanging silently. + +memblock_add() seems not appropriate, since using MAX_NUMNODES +as node id, while memblock_add_node() sets up memory for node id 0. + +Signed-off-by: Angelo Dureghello +Signed-off-by: Mike Rapoport +Signed-off-by: Greg Ungerer +Signed-off-by: Sasha Levin +--- + arch/m68k/mm/mcfmmu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c +index 0ea375607767c..2c57f46facc0e 100644 +--- a/arch/m68k/mm/mcfmmu.c ++++ b/arch/m68k/mm/mcfmmu.c +@@ -178,7 +178,7 @@ void __init cf_bootmem_alloc(void) + m68k_memory[0].addr = _rambase; + m68k_memory[0].size = _ramend - _rambase; + +- memblock_add(m68k_memory[0].addr, m68k_memory[0].size); ++ memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0); + + /* compute total pages in system */ + num_pages = PFN_DOWN(_ramend - _rambase); +-- +2.25.1 + diff --git a/queue-5.7/m68k-nommu-register-start-of-the-memory-with-membloc.patch b/queue-5.7/m68k-nommu-register-start-of-the-memory-with-membloc.patch new file mode 100644 index 00000000000..dbf33041112 --- /dev/null +++ b/queue-5.7/m68k-nommu-register-start-of-the-memory-with-membloc.patch @@ -0,0 +1,63 @@ +From 8cf448ca239f250564d6bf098b8e7f3610bf8af7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 Jun 2020 09:53:40 +0300 +Subject: m68k: nommu: register start of the memory with memblock + +From: Mike Rapoport + +[ Upstream commit d63bd8c81d8ab64db506ffde569cc8ff197516e2 ] + +The m68k nommu setup code didn't register the beginning of the physical +memory with memblock because it was anyway occupied by the kernel. However, +commit fa3354e4ea39 ("mm: free_area_init: use maximal zone PFNs rather than +zone sizes") changed zones initialization to use memblock.memory to detect +the zone extents and this caused inconsistency between zone PFNs and the +actual PFNs: + +BUG: Bad page state in process swapper pfn:20165 +page:41fe0ca0 refcount:0 mapcount:1 mapping:00000000 index:0x0 flags: 0x0() +raw: 00000000 00000100 00000122 00000000 00000000 00000000 00000000 00000000 +page dumped because: nonzero mapcount +CPU: 0 PID: 1 Comm: swapper Not tainted 5.8.0-rc1-00001-g3a38f8a60c65-dirty #1 +Stack from 404c9ebc: + 404c9ebc 4029ab28 4029ab28 40088470 41fe0ca0 40299e21 40299df1 404ba2a4 + 00020165 00000000 41fd2c10 402c7ba0 41fd2c04 40088504 41fe0ca0 40299e21 + 00000000 40088a12 41fe0ca0 41fe0ca4 0000020a 00000000 00000001 402ca000 + 00000000 41fe0ca0 41fd2c10 41fd2c10 00000000 00000000 402b2388 00000001 + 400a0934 40091056 404c9f44 404c9f44 40088db4 402c7ba0 00000001 41fd2c04 + 41fe0ca0 41fd2000 41fe0ca0 40089e02 4026ecf4 40089e4e 41fe0ca0 ffffffff +Call Trace: + [<40088470>] 0x40088470 + [<40088504>] 0x40088504 + [<40088a12>] 0x40088a12 + [<402ca000>] 0x402ca000 + [<400a0934>] 0x400a0934 + +Adjust the memory registration with memblock to include the beginning of +the physical memory and make sure that the area occupied by the kernel is +marked as reserved. + +Signed-off-by: Mike Rapoport +Signed-off-by: Greg Ungerer +Signed-off-by: Sasha Levin +--- + arch/m68k/kernel/setup_no.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c +index a63483de7a422..5dacba392c74e 100644 +--- a/arch/m68k/kernel/setup_no.c ++++ b/arch/m68k/kernel/setup_no.c +@@ -139,7 +139,8 @@ void __init setup_arch(char **cmdline_p) + pr_debug("MEMORY -> ROMFS=0x%p-0x%06lx MEM=0x%06lx-0x%06lx\n ", + __bss_stop, memory_start, memory_start, memory_end); + +- memblock_add(memory_start, memory_end - memory_start); ++ memblock_add(_rambase, memory_end - _rambase); ++ memblock_reserve(_rambase, memory_start - _rambase); + + /* Keep a copy of command line */ + *cmdline_p = &command_line[0]; +-- +2.25.1 + diff --git a/queue-5.7/series b/queue-5.7/series index dbe252556e4..19a67392400 100644 --- a/queue-5.7/series +++ b/queue-5.7/series @@ -29,3 +29,30 @@ ethtool-fix-genlmsg_put-failure-handling-in-ethnl_default_dumpit.patch mptcp-fix-dss-map-generation-on-fin-retransmission.patch net-rmnet-do-not-allow-to-add-multiple-bridge-interfaces.patch hsr-fix-interface-leak-in-error-path-of-hsr_dev_finalize.patch +drm-msm-fix-potential-memleak-in-error-branch.patch +drm-msm-dpu-allow-initialization-of-encoder-locks-du.patch +drm-exynos-properly-propagate-return-value-in-drm_io.patch +drm-exynos-fix-ref-count-leak-in-mic_pre_enable.patch +x86-fpu-reset-mxcsr-to-default-in-kernel_fpu_begin.patch +thermal-drivers-imx-fix-missing-of_node_put-at-probe.patch +acpi-dptf-add-battery-participant-for-tigerlake.patch +blk-mq-debugfs-update-blk_queue_flag_name-accordingl.patch +m68k-nommu-register-start-of-the-memory-with-membloc.patch +m68k-mm-fix-node-memblock-init.patch +dt-bindings-bus-uniphier-system-bus-fix-warning-in-e.patch +dt-bindings-mailbox-zynqmp_ipi-fix-unit-address.patch +dt-bindings-fix-error-in-make-clean-after-make-dt_bi.patch +cifs-prevent-truncation-from-long-to-int-in-wait_for.patch +arm64-alternatives-use-subsections-for-replacement-s.patch +tpm_tis-extra-chip-ops-check-on-error-path-in-tpm_ti.patch +xen-xenbus-avoid-large-structs-and-arrays-on-the-sta.patch +xen-xenbus-let-xenbus_map_ring_valloc-return-errno-v.patch +gfs2-eliminate-gif_ordered-in-favor-of-list_empty.patch +gfs2-freeze-should-work-on-read-only-mounts.patch +gfs2-read-only-mounts-should-grab-the-sd_freeze_gl-g.patch +gfs2-when-freezing-gfs2-use-gl_exact-and-not-gl_noca.patch +gfs2-the-freeze-glock-should-never-be-frozen.patch +arm64-add-midr-value-for-kryo4xx-gold-cpu-cores.patch +arm64-add-kryo4xx-gold-cpu-cores-to-erratum-list-146.patch +arm64-add-kryo4xx-silver-cpu-cores-to-erratum-list-1.patch +i2c-eg20t-load-module-automatically-if-id-matches.patch diff --git a/queue-5.7/thermal-drivers-imx-fix-missing-of_node_put-at-probe.patch b/queue-5.7/thermal-drivers-imx-fix-missing-of_node_put-at-probe.patch new file mode 100644 index 00000000000..4da24ea7bdf --- /dev/null +++ b/queue-5.7/thermal-drivers-imx-fix-missing-of_node_put-at-probe.patch @@ -0,0 +1,51 @@ +From 152d498bf770219af8b7c9833c7222ae58cd6fd2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Mar 2020 22:29:05 +0800 +Subject: thermal/drivers: imx: Fix missing of_node_put() at probe time + +From: Anson Huang + +[ Upstream commit b45fd13be340e4ed0a2a9673ba299eb2a71ba829 ] + +After finishing using cpu node got from of_get_cpu_node(), of_node_put() +needs to be called. + +Signed-off-by: Anson Huang +Signed-off-by: Daniel Lezcano +Link: https://lore.kernel.org/r/1585232945-23368-1-git-send-email-Anson.Huang@nxp.com +Signed-off-by: Sasha Levin +--- + drivers/thermal/imx_thermal.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c +index e761c9b422179..1b84ea674edb7 100644 +--- a/drivers/thermal/imx_thermal.c ++++ b/drivers/thermal/imx_thermal.c +@@ -649,7 +649,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match); + static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) + { + struct device_node *np; +- int ret; ++ int ret = 0; + + data->policy = cpufreq_cpu_get(0); + if (!data->policy) { +@@ -664,11 +664,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) + if (IS_ERR(data->cdev)) { + ret = PTR_ERR(data->cdev); + cpufreq_cpu_put(data->policy); +- return ret; + } + } + +- return 0; ++ of_node_put(np); ++ ++ return ret; + } + + static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data) +-- +2.25.1 + diff --git a/queue-5.7/tpm_tis-extra-chip-ops-check-on-error-path-in-tpm_ti.patch b/queue-5.7/tpm_tis-extra-chip-ops-check-on-error-path-in-tpm_ti.patch new file mode 100644 index 00000000000..505c726a289 --- /dev/null +++ b/queue-5.7/tpm_tis-extra-chip-ops-check-on-error-path-in-tpm_ti.patch @@ -0,0 +1,42 @@ +From 212ec4c8e6e06801d295d4fd397f652a3a490c3b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 13 Jun 2020 17:18:33 +0300 +Subject: tpm_tis: extra chip->ops check on error path in tpm_tis_core_init + +From: Vasily Averin + +[ Upstream commit ccf6fb858e17a8f8a914a1c6444d277cfedfeae6 ] + +Found by smatch: +drivers/char/tpm/tpm_tis_core.c:1088 tpm_tis_core_init() warn: + variable dereferenced before check 'chip->ops' (see line 979) + +'chip->ops' is assigned in the beginning of function +in tpmm_chip_alloc->tpm_chip_alloc +and is used before first possible goto to error path. + +Signed-off-by: Vasily Averin +Reviewed-by: Jerry Snitselaar +Reviewed-by: Jarkko Sakkinen +Signed-off-by: Jarkko Sakkinen +Signed-off-by: Sasha Levin +--- + drivers/char/tpm/tpm_tis_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c +index 2435216bd10aa..65ab1b027949c 100644 +--- a/drivers/char/tpm/tpm_tis_core.c ++++ b/drivers/char/tpm/tpm_tis_core.c +@@ -1085,7 +1085,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, + + return 0; + out_err: +- if ((chip->ops != NULL) && (chip->ops->clk_enable != NULL)) ++ if (chip->ops->clk_enable != NULL) + chip->ops->clk_enable(chip, false); + + tpm_tis_remove(chip); +-- +2.25.1 + diff --git a/queue-5.7/x86-fpu-reset-mxcsr-to-default-in-kernel_fpu_begin.patch b/queue-5.7/x86-fpu-reset-mxcsr-to-default-in-kernel_fpu_begin.patch new file mode 100644 index 00000000000..1eea11ef3af --- /dev/null +++ b/queue-5.7/x86-fpu-reset-mxcsr-to-default-in-kernel_fpu_begin.patch @@ -0,0 +1,66 @@ +From 206dde3184ce897d5ae8209980b17aa134468a5c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 Jun 2020 11:12:57 +0200 +Subject: x86/fpu: Reset MXCSR to default in kernel_fpu_begin() + +From: Petteri Aimonen + +[ Upstream commit 7ad816762f9bf89e940e618ea40c43138b479e10 ] + +Previously, kernel floating point code would run with the MXCSR control +register value last set by userland code by the thread that was active +on the CPU core just before kernel call. This could affect calculation +results if rounding mode was changed, or a crash if a FPU/SIMD exception +was unmasked. + +Restore MXCSR to the kernel's default value. + + [ bp: Carve out from a bigger patch by Petteri, add feature check, add + FNINIT call too (amluto). ] + +Signed-off-by: Petteri Aimonen +Signed-off-by: Borislav Petkov +Link: https://bugzilla.kernel.org/show_bug.cgi?id=207979 +Link: https://lkml.kernel.org/r/20200624114646.28953-2-bp@alien8.de +Signed-off-by: Sasha Levin +--- + arch/x86/include/asm/fpu/internal.h | 5 +++++ + arch/x86/kernel/fpu/core.c | 6 ++++++ + 2 files changed, 11 insertions(+) + +diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h +index 44c48e34d7994..00eac7f1529b0 100644 +--- a/arch/x86/include/asm/fpu/internal.h ++++ b/arch/x86/include/asm/fpu/internal.h +@@ -619,6 +619,11 @@ static inline void switch_fpu_finish(struct fpu *new_fpu) + * MXCSR and XCR definitions: + */ + ++static inline void ldmxcsr(u32 mxcsr) ++{ ++ asm volatile("ldmxcsr %0" :: "m" (mxcsr)); ++} ++ + extern unsigned int mxcsr_feature_mask; + + #define XCR_XFEATURE_ENABLED_MASK 0x00000000 +diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c +index 12c70840980e4..cd8839027f66d 100644 +--- a/arch/x86/kernel/fpu/core.c ++++ b/arch/x86/kernel/fpu/core.c +@@ -101,6 +101,12 @@ void kernel_fpu_begin(void) + copy_fpregs_to_fpstate(¤t->thread.fpu); + } + __cpu_invalidate_fpregs_state(); ++ ++ if (boot_cpu_has(X86_FEATURE_XMM)) ++ ldmxcsr(MXCSR_DEFAULT); ++ ++ if (boot_cpu_has(X86_FEATURE_FPU)) ++ asm volatile ("fninit"); + } + EXPORT_SYMBOL_GPL(kernel_fpu_begin); + +-- +2.25.1 + diff --git a/queue-5.7/xen-xenbus-avoid-large-structs-and-arrays-on-the-sta.patch b/queue-5.7/xen-xenbus-avoid-large-structs-and-arrays-on-the-sta.patch new file mode 100644 index 00000000000..058c5165d81 --- /dev/null +++ b/queue-5.7/xen-xenbus-avoid-large-structs-and-arrays-on-the-sta.patch @@ -0,0 +1,388 @@ +From 073c01bfe191a89961490c47c7e67af228c78edd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 1 Jul 2020 14:16:37 +0200 +Subject: xen/xenbus: avoid large structs and arrays on the stack + +From: Juergen Gross + +[ Upstream commit 3848e4e0a32afb96dc3b84e1358c3b9d103c6a2c ] + +xenbus_map_ring_valloc() and its sub-functions are putting quite large +structs and arrays on the stack. This is problematic at runtime, but +might also result in build failures (e.g. with clang due to the option +-Werror,-Wframe-larger-than=... used). + +Fix that by moving most of the data from the stack into a dynamically +allocated struct. Performance is no issue here, as +xenbus_map_ring_valloc() is used only when adding a new PV device to +a backend driver. + +While at it move some duplicated code from pv/hvm specific mapping +functions to the single caller. + +Reported-by: Arnd Bergmann +Signed-off-by: Juergen Gross +Reviewed-by: Boris Ostrovsky +Link: https://lore.kernel.org/r/20200701121638.19840-2-jgross@suse.com +Signed-off-by: Boris Ostrovsky +Signed-off-by: Sasha Levin +--- + drivers/xen/xenbus/xenbus_client.c | 161 +++++++++++++++-------------- + 1 file changed, 83 insertions(+), 78 deletions(-) + +diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c +index 040d2a43e8e35..9f8372079ecfa 100644 +--- a/drivers/xen/xenbus/xenbus_client.c ++++ b/drivers/xen/xenbus/xenbus_client.c +@@ -69,11 +69,27 @@ struct xenbus_map_node { + unsigned int nr_handles; + }; + ++struct map_ring_valloc { ++ struct xenbus_map_node *node; ++ ++ /* Why do we need two arrays? See comment of __xenbus_map_ring */ ++ union { ++ unsigned long addrs[XENBUS_MAX_RING_GRANTS]; ++ pte_t *ptes[XENBUS_MAX_RING_GRANTS]; ++ }; ++ phys_addr_t phys_addrs[XENBUS_MAX_RING_GRANTS]; ++ ++ struct gnttab_map_grant_ref map[XENBUS_MAX_RING_GRANTS]; ++ struct gnttab_unmap_grant_ref unmap[XENBUS_MAX_RING_GRANTS]; ++ ++ unsigned int idx; /* HVM only. */ ++}; ++ + static DEFINE_SPINLOCK(xenbus_valloc_lock); + static LIST_HEAD(xenbus_valloc_pages); + + struct xenbus_ring_ops { +- int (*map)(struct xenbus_device *dev, ++ int (*map)(struct xenbus_device *dev, struct map_ring_valloc *info, + grant_ref_t *gnt_refs, unsigned int nr_grefs, + void **vaddr); + int (*unmap)(struct xenbus_device *dev, void *vaddr); +@@ -449,12 +465,32 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, grant_ref_t *gnt_refs, + unsigned int nr_grefs, void **vaddr) + { + int err; ++ struct map_ring_valloc *info; ++ ++ *vaddr = NULL; ++ ++ if (nr_grefs > XENBUS_MAX_RING_GRANTS) ++ return -EINVAL; ++ ++ info = kzalloc(sizeof(*info), GFP_KERNEL); ++ if (!info) ++ return -ENOMEM; ++ ++ info->node = kzalloc(sizeof(*info->node), GFP_KERNEL); ++ if (!info->node) { ++ err = -ENOMEM; ++ goto out; ++ } ++ ++ err = ring_ops->map(dev, info, gnt_refs, nr_grefs, vaddr); + +- err = ring_ops->map(dev, gnt_refs, nr_grefs, vaddr); + /* Some hypervisors are buggy and can return 1. */ + if (err > 0) + err = GNTST_general_error; + ++ out: ++ kfree(info->node); ++ kfree(info); + return err; + } + EXPORT_SYMBOL_GPL(xenbus_map_ring_valloc); +@@ -466,12 +502,10 @@ static int __xenbus_map_ring(struct xenbus_device *dev, + grant_ref_t *gnt_refs, + unsigned int nr_grefs, + grant_handle_t *handles, +- phys_addr_t *addrs, ++ struct map_ring_valloc *info, + unsigned int flags, + bool *leaked) + { +- struct gnttab_map_grant_ref map[XENBUS_MAX_RING_GRANTS]; +- struct gnttab_unmap_grant_ref unmap[XENBUS_MAX_RING_GRANTS]; + int i, j; + int err = GNTST_okay; + +@@ -479,23 +513,22 @@ static int __xenbus_map_ring(struct xenbus_device *dev, + return -EINVAL; + + for (i = 0; i < nr_grefs; i++) { +- memset(&map[i], 0, sizeof(map[i])); +- gnttab_set_map_op(&map[i], addrs[i], flags, gnt_refs[i], +- dev->otherend_id); ++ gnttab_set_map_op(&info->map[i], info->phys_addrs[i], flags, ++ gnt_refs[i], dev->otherend_id); + handles[i] = INVALID_GRANT_HANDLE; + } + +- gnttab_batch_map(map, i); ++ gnttab_batch_map(info->map, i); + + for (i = 0; i < nr_grefs; i++) { +- if (map[i].status != GNTST_okay) { +- err = map[i].status; +- xenbus_dev_fatal(dev, map[i].status, ++ if (info->map[i].status != GNTST_okay) { ++ err = info->map[i].status; ++ xenbus_dev_fatal(dev, info->map[i].status, + "mapping in shared page %d from domain %d", + gnt_refs[i], dev->otherend_id); + goto fail; + } else +- handles[i] = map[i].handle; ++ handles[i] = info->map[i].handle; + } + + return GNTST_okay; +@@ -503,19 +536,19 @@ static int __xenbus_map_ring(struct xenbus_device *dev, + fail: + for (i = j = 0; i < nr_grefs; i++) { + if (handles[i] != INVALID_GRANT_HANDLE) { +- memset(&unmap[j], 0, sizeof(unmap[j])); +- gnttab_set_unmap_op(&unmap[j], (phys_addr_t)addrs[i], ++ gnttab_set_unmap_op(&info->unmap[j], ++ info->phys_addrs[i], + GNTMAP_host_map, handles[i]); + j++; + } + } + +- if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap, j)) ++ if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, info->unmap, j)) + BUG(); + + *leaked = false; + for (i = 0; i < j; i++) { +- if (unmap[i].status != GNTST_okay) { ++ if (info->unmap[i].status != GNTST_okay) { + *leaked = true; + break; + } +@@ -566,21 +599,12 @@ static int xenbus_unmap_ring(struct xenbus_device *dev, grant_handle_t *handles, + return err; + } + +-struct map_ring_valloc_hvm +-{ +- unsigned int idx; +- +- /* Why do we need two arrays? See comment of __xenbus_map_ring */ +- phys_addr_t phys_addrs[XENBUS_MAX_RING_GRANTS]; +- unsigned long addrs[XENBUS_MAX_RING_GRANTS]; +-}; +- + static void xenbus_map_ring_setup_grant_hvm(unsigned long gfn, + unsigned int goffset, + unsigned int len, + void *data) + { +- struct map_ring_valloc_hvm *info = data; ++ struct map_ring_valloc *info = data; + unsigned long vaddr = (unsigned long)gfn_to_virt(gfn); + + info->phys_addrs[info->idx] = vaddr; +@@ -589,39 +613,28 @@ static void xenbus_map_ring_setup_grant_hvm(unsigned long gfn, + info->idx++; + } + +-static int xenbus_map_ring_valloc_hvm(struct xenbus_device *dev, +- grant_ref_t *gnt_ref, +- unsigned int nr_grefs, +- void **vaddr) ++static int xenbus_map_ring_hvm(struct xenbus_device *dev, ++ struct map_ring_valloc *info, ++ grant_ref_t *gnt_ref, ++ unsigned int nr_grefs, ++ void **vaddr) + { +- struct xenbus_map_node *node; ++ struct xenbus_map_node *node = info->node; + int err; + void *addr; + bool leaked = false; +- struct map_ring_valloc_hvm info = { +- .idx = 0, +- }; + unsigned int nr_pages = XENBUS_PAGES(nr_grefs); + +- if (nr_grefs > XENBUS_MAX_RING_GRANTS) +- return -EINVAL; +- +- *vaddr = NULL; +- +- node = kzalloc(sizeof(*node), GFP_KERNEL); +- if (!node) +- return -ENOMEM; +- + err = alloc_xenballooned_pages(nr_pages, node->hvm.pages); + if (err) + goto out_err; + + gnttab_foreach_grant(node->hvm.pages, nr_grefs, + xenbus_map_ring_setup_grant_hvm, +- &info); ++ info); + + err = __xenbus_map_ring(dev, gnt_ref, nr_grefs, node->handles, +- info.phys_addrs, GNTMAP_host_map, &leaked); ++ info, GNTMAP_host_map, &leaked); + node->nr_handles = nr_grefs; + + if (err) +@@ -641,11 +654,13 @@ static int xenbus_map_ring_valloc_hvm(struct xenbus_device *dev, + spin_unlock(&xenbus_valloc_lock); + + *vaddr = addr; ++ info->node = NULL; ++ + return 0; + + out_xenbus_unmap_ring: + if (!leaked) +- xenbus_unmap_ring(dev, node->handles, nr_grefs, info.addrs); ++ xenbus_unmap_ring(dev, node->handles, nr_grefs, info->addrs); + else + pr_alert("leaking %p size %u page(s)", + addr, nr_pages); +@@ -653,7 +668,6 @@ static int xenbus_map_ring_valloc_hvm(struct xenbus_device *dev, + if (!leaked) + free_xenballooned_pages(nr_pages, node->hvm.pages); + out_err: +- kfree(node); + return err; + } + +@@ -676,40 +690,30 @@ int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr) + EXPORT_SYMBOL_GPL(xenbus_unmap_ring_vfree); + + #ifdef CONFIG_XEN_PV +-static int xenbus_map_ring_valloc_pv(struct xenbus_device *dev, +- grant_ref_t *gnt_refs, +- unsigned int nr_grefs, +- void **vaddr) ++static int xenbus_map_ring_pv(struct xenbus_device *dev, ++ struct map_ring_valloc *info, ++ grant_ref_t *gnt_refs, ++ unsigned int nr_grefs, ++ void **vaddr) + { +- struct xenbus_map_node *node; ++ struct xenbus_map_node *node = info->node; + struct vm_struct *area; +- pte_t *ptes[XENBUS_MAX_RING_GRANTS]; +- phys_addr_t phys_addrs[XENBUS_MAX_RING_GRANTS]; + int err = GNTST_okay; + int i; + bool leaked; + +- *vaddr = NULL; +- +- if (nr_grefs > XENBUS_MAX_RING_GRANTS) +- return -EINVAL; +- +- node = kzalloc(sizeof(*node), GFP_KERNEL); +- if (!node) +- return -ENOMEM; +- +- area = alloc_vm_area(XEN_PAGE_SIZE * nr_grefs, ptes); ++ area = alloc_vm_area(XEN_PAGE_SIZE * nr_grefs, info->ptes); + if (!area) { + kfree(node); + return -ENOMEM; + } + + for (i = 0; i < nr_grefs; i++) +- phys_addrs[i] = arbitrary_virt_to_machine(ptes[i]).maddr; ++ info->phys_addrs[i] = ++ arbitrary_virt_to_machine(info->ptes[i]).maddr; + + err = __xenbus_map_ring(dev, gnt_refs, nr_grefs, node->handles, +- phys_addrs, +- GNTMAP_host_map | GNTMAP_contains_pte, ++ info, GNTMAP_host_map | GNTMAP_contains_pte, + &leaked); + if (err) + goto failed; +@@ -722,6 +726,8 @@ static int xenbus_map_ring_valloc_pv(struct xenbus_device *dev, + spin_unlock(&xenbus_valloc_lock); + + *vaddr = area->addr; ++ info->node = NULL; ++ + return 0; + + failed: +@@ -730,11 +736,10 @@ failed: + else + pr_alert("leaking VM area %p size %u page(s)", area, nr_grefs); + +- kfree(node); + return err; + } + +-static int xenbus_unmap_ring_vfree_pv(struct xenbus_device *dev, void *vaddr) ++static int xenbus_unmap_ring_pv(struct xenbus_device *dev, void *vaddr) + { + struct xenbus_map_node *node; + struct gnttab_unmap_grant_ref unmap[XENBUS_MAX_RING_GRANTS]; +@@ -798,12 +803,12 @@ static int xenbus_unmap_ring_vfree_pv(struct xenbus_device *dev, void *vaddr) + } + + static const struct xenbus_ring_ops ring_ops_pv = { +- .map = xenbus_map_ring_valloc_pv, +- .unmap = xenbus_unmap_ring_vfree_pv, ++ .map = xenbus_map_ring_pv, ++ .unmap = xenbus_unmap_ring_pv, + }; + #endif + +-struct unmap_ring_vfree_hvm ++struct unmap_ring_hvm + { + unsigned int idx; + unsigned long addrs[XENBUS_MAX_RING_GRANTS]; +@@ -814,19 +819,19 @@ static void xenbus_unmap_ring_setup_grant_hvm(unsigned long gfn, + unsigned int len, + void *data) + { +- struct unmap_ring_vfree_hvm *info = data; ++ struct unmap_ring_hvm *info = data; + + info->addrs[info->idx] = (unsigned long)gfn_to_virt(gfn); + + info->idx++; + } + +-static int xenbus_unmap_ring_vfree_hvm(struct xenbus_device *dev, void *vaddr) ++static int xenbus_unmap_ring_hvm(struct xenbus_device *dev, void *vaddr) + { + int rv; + struct xenbus_map_node *node; + void *addr; +- struct unmap_ring_vfree_hvm info = { ++ struct unmap_ring_hvm info = { + .idx = 0, + }; + unsigned int nr_pages; +@@ -887,8 +892,8 @@ enum xenbus_state xenbus_read_driver_state(const char *path) + EXPORT_SYMBOL_GPL(xenbus_read_driver_state); + + static const struct xenbus_ring_ops ring_ops_hvm = { +- .map = xenbus_map_ring_valloc_hvm, +- .unmap = xenbus_unmap_ring_vfree_hvm, ++ .map = xenbus_map_ring_hvm, ++ .unmap = xenbus_unmap_ring_hvm, + }; + + void __init xenbus_ring_ops_init(void) +-- +2.25.1 + diff --git a/queue-5.7/xen-xenbus-let-xenbus_map_ring_valloc-return-errno-v.patch b/queue-5.7/xen-xenbus-let-xenbus_map_ring_valloc-return-errno-v.patch new file mode 100644 index 00000000000..305c4723d49 --- /dev/null +++ b/queue-5.7/xen-xenbus-let-xenbus_map_ring_valloc-return-errno-v.patch @@ -0,0 +1,101 @@ +From e82fdf58074c4b57d4642f8893015a74a494ded4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 1 Jul 2020 14:16:38 +0200 +Subject: xen/xenbus: let xenbus_map_ring_valloc() return errno values only + +From: Juergen Gross + +[ Upstream commit 578c1bb9056263ad3c9e09746b3d6e4daf63bdb0 ] + +Today xenbus_map_ring_valloc() can return either a negative errno +value (-ENOMEM or -EINVAL) or a grant status value. This is a mess as +e.g -ENOMEM and GNTST_eagain have the same numeric value. + +Fix that by turning all grant mapping errors into -ENOENT. This is +no problem as all callers of xenbus_map_ring_valloc() only use the +return value to print an error message, and in case of mapping errors +the grant status value has already been printed by __xenbus_map_ring() +before. + +Signed-off-by: Juergen Gross +Reviewed-by: Boris Ostrovsky +Link: https://lore.kernel.org/r/20200701121638.19840-3-jgross@suse.com +Signed-off-by: Boris Ostrovsky +Signed-off-by: Sasha Levin +--- + drivers/xen/xenbus/xenbus_client.c | 22 ++++++---------------- + 1 file changed, 6 insertions(+), 16 deletions(-) + +diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c +index 9f8372079ecfa..4f168b46fbca5 100644 +--- a/drivers/xen/xenbus/xenbus_client.c ++++ b/drivers/xen/xenbus/xenbus_client.c +@@ -456,8 +456,7 @@ EXPORT_SYMBOL_GPL(xenbus_free_evtchn); + * Map @nr_grefs pages of memory into this domain from another + * domain's grant table. xenbus_map_ring_valloc allocates @nr_grefs + * pages of virtual address space, maps the pages to that address, and +- * sets *vaddr to that address. Returns 0 on success, and GNTST_* +- * (see xen/include/interface/grant_table.h) or -ENOMEM / -EINVAL on ++ * sets *vaddr to that address. Returns 0 on success, and -errno on + * error. If an error is returned, device will switch to + * XenbusStateClosing and the error message will be saved in XenStore. + */ +@@ -477,18 +476,11 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, grant_ref_t *gnt_refs, + return -ENOMEM; + + info->node = kzalloc(sizeof(*info->node), GFP_KERNEL); +- if (!info->node) { ++ if (!info->node) + err = -ENOMEM; +- goto out; +- } +- +- err = ring_ops->map(dev, info, gnt_refs, nr_grefs, vaddr); +- +- /* Some hypervisors are buggy and can return 1. */ +- if (err > 0) +- err = GNTST_general_error; ++ else ++ err = ring_ops->map(dev, info, gnt_refs, nr_grefs, vaddr); + +- out: + kfree(info->node); + kfree(info); + return err; +@@ -507,7 +499,6 @@ static int __xenbus_map_ring(struct xenbus_device *dev, + bool *leaked) + { + int i, j; +- int err = GNTST_okay; + + if (nr_grefs > XENBUS_MAX_RING_GRANTS) + return -EINVAL; +@@ -522,7 +513,6 @@ static int __xenbus_map_ring(struct xenbus_device *dev, + + for (i = 0; i < nr_grefs; i++) { + if (info->map[i].status != GNTST_okay) { +- err = info->map[i].status; + xenbus_dev_fatal(dev, info->map[i].status, + "mapping in shared page %d from domain %d", + gnt_refs[i], dev->otherend_id); +@@ -531,7 +521,7 @@ static int __xenbus_map_ring(struct xenbus_device *dev, + handles[i] = info->map[i].handle; + } + +- return GNTST_okay; ++ return 0; + + fail: + for (i = j = 0; i < nr_grefs; i++) { +@@ -554,7 +544,7 @@ static int __xenbus_map_ring(struct xenbus_device *dev, + } + } + +- return err; ++ return -ENOENT; + } + + /** +-- +2.25.1 +