summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--0001-Add-Red-Hat-tainting.patch2
-rw-r--r--0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch2
-rw-r--r--0001-Drop-that-for-now.patch2
-rw-r--r--0001-Rename-RH_DISABLE_DEPRECATED-to-RHEL_DIFFERENCES.patch2
-rw-r--r--0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch2
-rw-r--r--0001-put-RHEL-info-into-generated-headers.patch4
-rw-r--r--kernel-aarch64-debug-fedora.config7
-rw-r--r--kernel-aarch64-debug-rhel.config4
-rw-r--r--kernel-aarch64-fedora.config7
-rw-r--r--kernel-aarch64-rhel.config4
-rw-r--r--kernel-armv7hl-debug-fedora.config7
-rw-r--r--kernel-armv7hl-fedora.config7
-rw-r--r--kernel-armv7hl-lpae-debug-fedora.config7
-rw-r--r--kernel-armv7hl-lpae-fedora.config7
-rw-r--r--kernel-i686-debug-fedora.config5
-rw-r--r--kernel-i686-fedora.config5
-rw-r--r--kernel-ppc64le-debug-fedora.config5
-rw-r--r--kernel-ppc64le-debug-rhel.config4
-rw-r--r--kernel-ppc64le-fedora.config5
-rw-r--r--kernel-ppc64le-rhel.config4
-rw-r--r--kernel-s390x-debug-fedora.config5
-rw-r--r--kernel-s390x-debug-rhel.config4
-rw-r--r--kernel-s390x-fedora.config5
-rw-r--r--kernel-s390x-rhel.config4
-rw-r--r--kernel-s390x-zfcpdump-rhel.config4
-rw-r--r--kernel-x86_64-debug-fedora.config5
-rw-r--r--kernel-x86_64-debug-rhel.config4
-rw-r--r--kernel-x86_64-fedora.config5
-rw-r--r--kernel-x86_64-rhel.config4
-rw-r--r--kernel.spec23
-rw-r--r--sources6
31 files changed, 112 insertions, 49 deletions
diff --git a/0001-Add-Red-Hat-tainting.patch b/0001-Add-Red-Hat-tainting.patch
index f743a025d..4aa92bd9f 100644
--- a/0001-Add-Red-Hat-tainting.patch
+++ b/0001-Add-Red-Hat-tainting.patch
@@ -124,7 +124,7 @@ index 82d91547d122..b82db0c0caec 100644
+
#endif
diff --git a/kernel/Makefile b/kernel/Makefile
-index c332eb9d4841..281e1abbe3b2 100644
+index ce8716a04d0e..54c00c4719ab 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -12,6 +12,8 @@ obj-y = fork.o exec_domain.o panic.o \
diff --git a/0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch b/0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch
index f67328da1..33a7efb26 100644
--- a/0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch
+++ b/0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch
@@ -16,7 +16,7 @@ Signed-off-by: Jeremy Cline <jcline@redhat.com>
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
-index 2fba78e84d53..47f5f3c8c7aa 100644
+index cb73d398a2fe..2c2b7760c13c 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1133,6 +1133,7 @@ config XEN
diff --git a/0001-Drop-that-for-now.patch b/0001-Drop-that-for-now.patch
index 24ce306a1..acb3af04e 100644
--- a/0001-Drop-that-for-now.patch
+++ b/0001-Drop-that-for-now.patch
@@ -8,7 +8,7 @@ Subject: [PATCH] Drop that for now
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
-index d4d2a5c5d003..24ad272d3197 100644
+index 07e96d9ab020..e9d06886f99c 100644
--- a/Makefile
+++ b/Makefile
@@ -510,7 +510,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
diff --git a/0001-Rename-RH_DISABLE_DEPRECATED-to-RHEL_DIFFERENCES.patch b/0001-Rename-RH_DISABLE_DEPRECATED-to-RHEL_DIFFERENCES.patch
index 873882a66..ae1c85483 100644
--- a/0001-Rename-RH_DISABLE_DEPRECATED-to-RHEL_DIFFERENCES.patch
+++ b/0001-Rename-RH_DISABLE_DEPRECATED-to-RHEL_DIFFERENCES.patch
@@ -64,7 +64,7 @@ index 0a0081b10edb..cfaaa6a234d4 100644
void mark_hardware_deprecated(const char *msg);
void mark_tech_preview(const char *msg, struct module *mod);
diff --git a/kernel/Makefile b/kernel/Makefile
-index 281e1abbe3b2..8da4dd1bafe0 100644
+index 54c00c4719ab..d4e404913f2e 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -12,7 +12,7 @@ obj-y = fork.o exec_domain.o panic.o \
diff --git a/0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch b/0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch
index 250d8aad9..63f9cc706 100644
--- a/0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch
+++ b/0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch
@@ -21,7 +21,7 @@ Signed-off-by: Jeremy Cline <jcline@redhat.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
-index 7f9d38444d6d..2fba78e84d53 100644
+index 8a46ed3ab429..cb73d398a2fe 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -861,7 +861,7 @@ endchoice
diff --git a/0001-put-RHEL-info-into-generated-headers.patch b/0001-put-RHEL-info-into-generated-headers.patch
index 1c326618b..8cc3ae7fb 100644
--- a/0001-put-RHEL-info-into-generated-headers.patch
+++ b/0001-put-RHEL-info-into-generated-headers.patch
@@ -59,10 +59,10 @@ Acked-by: Prarit Bhargava <prarit@redhat.com>
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
-index 839f9fee22cb..d4d2a5c5d003 100644
+index f0c1a3a8d9e4..07e96d9ab020 100644
--- a/Makefile
+++ b/Makefile
-@@ -1230,7 +1230,13 @@ endef
+@@ -1231,7 +1231,13 @@ endef
define filechk_version.h
echo \#define LINUX_VERSION_CODE $(shell \
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
diff --git a/kernel-aarch64-debug-fedora.config b/kernel-aarch64-debug-fedora.config
index b72a93b98..293a449f7 100644
--- a/kernel-aarch64-debug-fedora.config
+++ b/kernel-aarch64-debug-fedora.config
@@ -1471,7 +1471,9 @@ CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG_SG is not set
CONFIG_DMA_API_DEBUG=y
CONFIG_DMA_BCM2835=m
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMA_CMA=y
@@ -3825,7 +3827,7 @@ CONFIG_MSDOS_FS=m
CONFIG_MSDOS_PARTITION=y
CONFIG_MSM_GCC_8660=y
CONFIG_MSM_GCC_8916=y
-# CONFIG_MSM_GCC_8939 is not set
+CONFIG_MSM_GCC_8939=m
CONFIG_MSM_GCC_8960=y
CONFIG_MSM_GCC_8974=y
# CONFIG_MSM_GCC_8994 is not set
@@ -5085,6 +5087,7 @@ CONFIG_QCOM_HIDMA=m
CONFIG_QCOM_HIDMA_MGMT=m
CONFIG_QCOM_IOMMU=y
CONFIG_QCOM_IPA=m
+# CONFIG_QCOM_IPCC is not set
CONFIG_QCOM_IRQ_COMBINER=y
CONFIG_QCOM_L2_PMU=y
CONFIG_QCOM_L3_PMU=y
diff --git a/kernel-aarch64-debug-rhel.config b/kernel-aarch64-debug-rhel.config
index 159ac8c24..5e3475f80 100644
--- a/kernel-aarch64-debug-rhel.config
+++ b/kernel-aarch64-debug-rhel.config
@@ -1133,7 +1133,8 @@ CONFIG_DLCI_MAX=8
# CONFIG_DLM is not set
CONFIG_DMA_API_DEBUG_SG=y
CONFIG_DMA_API_DEBUG=y
-# CONFIG_DMABUF_HEAPS is not set
+# CONFIG_DMABUF_HEAPS_SYSTEM is not set
+CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_MOVE_NOTIFY=y
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -4102,6 +4103,7 @@ CONFIG_QCOM_FALKOR_ERRATUM_E1041=y
CONFIG_QCOM_HIDMA=m
CONFIG_QCOM_HIDMA_MGMT=m
# CONFIG_QCOM_IOMMU is not set
+# CONFIG_QCOM_IPCC is not set
CONFIG_QCOM_L2_PMU=y
CONFIG_QCOM_L3_PMU=y
# CONFIG_QCOM_LLCC is not set
diff --git a/kernel-aarch64-fedora.config b/kernel-aarch64-fedora.config
index 6bd664d2f..f26881668 100644
--- a/kernel-aarch64-fedora.config
+++ b/kernel-aarch64-fedora.config
@@ -1464,7 +1464,9 @@ CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_DMA_API_DEBUG_SG is not set
CONFIG_DMA_BCM2835=m
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMA_CMA=y
@@ -3806,7 +3808,7 @@ CONFIG_MSDOS_FS=m
CONFIG_MSDOS_PARTITION=y
CONFIG_MSM_GCC_8660=y
CONFIG_MSM_GCC_8916=y
-# CONFIG_MSM_GCC_8939 is not set
+CONFIG_MSM_GCC_8939=m
CONFIG_MSM_GCC_8960=y
CONFIG_MSM_GCC_8974=y
# CONFIG_MSM_GCC_8994 is not set
@@ -5066,6 +5068,7 @@ CONFIG_QCOM_HIDMA=m
CONFIG_QCOM_HIDMA_MGMT=m
CONFIG_QCOM_IOMMU=y
CONFIG_QCOM_IPA=m
+# CONFIG_QCOM_IPCC is not set
CONFIG_QCOM_IRQ_COMBINER=y
CONFIG_QCOM_L2_PMU=y
CONFIG_QCOM_L3_PMU=y
diff --git a/kernel-aarch64-rhel.config b/kernel-aarch64-rhel.config
index dd662d848..4c9fbee19 100644
--- a/kernel-aarch64-rhel.config
+++ b/kernel-aarch64-rhel.config
@@ -1125,7 +1125,8 @@ CONFIG_DLCI_MAX=8
# CONFIG_DLM is not set
# CONFIG_DMA_API_DEBUG is not set
CONFIG_DMA_API_DEBUG_SG=y
-# CONFIG_DMABUF_HEAPS is not set
+# CONFIG_DMABUF_HEAPS_SYSTEM is not set
+CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_MOVE_NOTIFY=y
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -4084,6 +4085,7 @@ CONFIG_QCOM_FALKOR_ERRATUM_E1041=y
CONFIG_QCOM_HIDMA=m
CONFIG_QCOM_HIDMA_MGMT=m
# CONFIG_QCOM_IOMMU is not set
+# CONFIG_QCOM_IPCC is not set
CONFIG_QCOM_L2_PMU=y
CONFIG_QCOM_L3_PMU=y
# CONFIG_QCOM_LLCC is not set
diff --git a/kernel-armv7hl-debug-fedora.config b/kernel-armv7hl-debug-fedora.config
index 52b8d361c..759003704 100644
--- a/kernel-armv7hl-debug-fedora.config
+++ b/kernel-armv7hl-debug-fedora.config
@@ -1474,7 +1474,9 @@ CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG_SG is not set
CONFIG_DMA_API_DEBUG=y
CONFIG_DMA_BCM2835=m
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMA_CMA=y
@@ -3901,7 +3903,7 @@ CONFIG_MSDOS_FS=m
CONFIG_MSDOS_PARTITION=y
CONFIG_MSM_GCC_8660=y
# CONFIG_MSM_GCC_8916 is not set
-# CONFIG_MSM_GCC_8939 is not set
+CONFIG_MSM_GCC_8939=m
CONFIG_MSM_GCC_8960=y
CONFIG_MSM_GCC_8974=y
# CONFIG_MSM_GCC_8994 is not set
@@ -5196,6 +5198,7 @@ CONFIG_QCOM_HFPLL=m
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
CONFIG_QCOM_IOMMU=y
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_LLCC is not set
CONFIG_QCOM_OCMEM=m
CONFIG_QCOM_PDC=y
diff --git a/kernel-armv7hl-fedora.config b/kernel-armv7hl-fedora.config
index 70204f77c..8aa49def2 100644
--- a/kernel-armv7hl-fedora.config
+++ b/kernel-armv7hl-fedora.config
@@ -1467,7 +1467,9 @@ CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_DMA_API_DEBUG_SG is not set
CONFIG_DMA_BCM2835=m
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMA_CMA=y
@@ -3883,7 +3885,7 @@ CONFIG_MSDOS_FS=m
CONFIG_MSDOS_PARTITION=y
CONFIG_MSM_GCC_8660=y
# CONFIG_MSM_GCC_8916 is not set
-# CONFIG_MSM_GCC_8939 is not set
+CONFIG_MSM_GCC_8939=m
CONFIG_MSM_GCC_8960=y
CONFIG_MSM_GCC_8974=y
# CONFIG_MSM_GCC_8994 is not set
@@ -5178,6 +5180,7 @@ CONFIG_QCOM_HFPLL=m
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
CONFIG_QCOM_IOMMU=y
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_LLCC is not set
CONFIG_QCOM_OCMEM=m
CONFIG_QCOM_PDC=y
diff --git a/kernel-armv7hl-lpae-debug-fedora.config b/kernel-armv7hl-lpae-debug-fedora.config
index 3a6027f6d..a47de25c3 100644
--- a/kernel-armv7hl-lpae-debug-fedora.config
+++ b/kernel-armv7hl-lpae-debug-fedora.config
@@ -1442,7 +1442,9 @@ CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG_SG is not set
CONFIG_DMA_API_DEBUG=y
CONFIG_DMA_BCM2835=m
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMA_CMA=y
@@ -3810,7 +3812,7 @@ CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS_BLOCK is not set
CONFIG_MSDOS_FS=m
CONFIG_MSDOS_PARTITION=y
-# CONFIG_MSM_GCC_8939 is not set
+CONFIG_MSM_GCC_8939=m
# CONFIG_MSM_GCC_8994 is not set
# CONFIG_MSM_GCC_8998 is not set
# CONFIG_MSM_GPUCC_8998 is not set
@@ -5054,6 +5056,7 @@ CONFIG_QCOM_FASTRPC=m
CONFIG_QCOM_HFPLL=m
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_LLCC is not set
CONFIG_QCOM_OCMEM=m
CONFIG_QCOM_PDC=y
diff --git a/kernel-armv7hl-lpae-fedora.config b/kernel-armv7hl-lpae-fedora.config
index f21655bb0..9ed55c066 100644
--- a/kernel-armv7hl-lpae-fedora.config
+++ b/kernel-armv7hl-lpae-fedora.config
@@ -1435,7 +1435,9 @@ CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_DMA_API_DEBUG_SG is not set
CONFIG_DMA_BCM2835=m
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMA_CMA=y
@@ -3792,7 +3794,7 @@ CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS_BLOCK is not set
CONFIG_MSDOS_FS=m
CONFIG_MSDOS_PARTITION=y
-# CONFIG_MSM_GCC_8939 is not set
+CONFIG_MSM_GCC_8939=m
# CONFIG_MSM_GCC_8994 is not set
# CONFIG_MSM_GCC_8998 is not set
# CONFIG_MSM_GPUCC_8998 is not set
@@ -5036,6 +5038,7 @@ CONFIG_QCOM_FASTRPC=m
CONFIG_QCOM_HFPLL=m
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_LLCC is not set
CONFIG_QCOM_OCMEM=m
CONFIG_QCOM_PDC=y
diff --git a/kernel-i686-debug-fedora.config b/kernel-i686-debug-fedora.config
index 97ac7e68e..6725d2f71 100644
--- a/kernel-i686-debug-fedora.config
+++ b/kernel-i686-debug-fedora.config
@@ -1231,7 +1231,9 @@ CONFIG_DLM=m
CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG_SG is not set
CONFIG_DMA_API_DEBUG=y
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMA_CMA=y
@@ -4636,6 +4638,7 @@ CONFIG_PWRSEQ_SIMPLE=m
# CONFIG_QCOM_EMAC is not set
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set
# CONFIG_QCS_TURING_404 is not set
diff --git a/kernel-i686-fedora.config b/kernel-i686-fedora.config
index d1555d529..e17241579 100644
--- a/kernel-i686-fedora.config
+++ b/kernel-i686-fedora.config
@@ -1223,7 +1223,9 @@ CONFIG_DLM=m
CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_DMA_API_DEBUG_SG is not set
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMA_CMA=y
@@ -4617,6 +4619,7 @@ CONFIG_PWRSEQ_SIMPLE=m
# CONFIG_QCOM_EMAC is not set
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set
# CONFIG_QCS_TURING_404 is not set
diff --git a/kernel-ppc64le-debug-fedora.config b/kernel-ppc64le-debug-fedora.config
index bcc7a659d..e1c064b42 100644
--- a/kernel-ppc64le-debug-fedora.config
+++ b/kernel-ppc64le-debug-fedora.config
@@ -1138,7 +1138,9 @@ CONFIG_DLM=m
CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG_SG is not set
CONFIG_DMA_API_DEBUG=y
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -4313,6 +4315,7 @@ CONFIG_PWRSEQ_SIMPLE=m
# CONFIG_QCOM_EMAC is not set
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set
# CONFIG_QCS_TURING_404 is not set
diff --git a/kernel-ppc64le-debug-rhel.config b/kernel-ppc64le-debug-rhel.config
index c7fceab62..db97bf5bc 100644
--- a/kernel-ppc64le-debug-rhel.config
+++ b/kernel-ppc64le-debug-rhel.config
@@ -1015,7 +1015,8 @@ CONFIG_DLM_DEBUG=y
CONFIG_DLM=m
CONFIG_DMA_API_DEBUG_SG=y
CONFIG_DMA_API_DEBUG=y
-# CONFIG_DMABUF_HEAPS is not set
+# CONFIG_DMABUF_HEAPS_SYSTEM is not set
+CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_MOVE_NOTIFY=y
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -3956,6 +3957,7 @@ CONFIG_QCOM_FALKOR_ERRATUM_1009=y
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_IOMMU is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_PDC is not set
CONFIG_QCOM_QDF2400_ERRATUM_0065=y
diff --git a/kernel-ppc64le-fedora.config b/kernel-ppc64le-fedora.config
index 5ffb79ace..b62992291 100644
--- a/kernel-ppc64le-fedora.config
+++ b/kernel-ppc64le-fedora.config
@@ -1130,7 +1130,9 @@ CONFIG_DLM=m
CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_DMA_API_DEBUG_SG is not set
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -4293,6 +4295,7 @@ CONFIG_PWRSEQ_SIMPLE=m
# CONFIG_QCOM_EMAC is not set
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set
# CONFIG_QCS_TURING_404 is not set
diff --git a/kernel-ppc64le-rhel.config b/kernel-ppc64le-rhel.config
index 794d0b553..b6503be31 100644
--- a/kernel-ppc64le-rhel.config
+++ b/kernel-ppc64le-rhel.config
@@ -1007,7 +1007,8 @@ CONFIG_DLM_DEBUG=y
CONFIG_DLM=m
# CONFIG_DMA_API_DEBUG is not set
CONFIG_DMA_API_DEBUG_SG=y
-# CONFIG_DMABUF_HEAPS is not set
+# CONFIG_DMABUF_HEAPS_SYSTEM is not set
+CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_MOVE_NOTIFY=y
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -3940,6 +3941,7 @@ CONFIG_QCOM_FALKOR_ERRATUM_1009=y
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_IOMMU is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_PDC is not set
CONFIG_QCOM_QDF2400_ERRATUM_0065=y
diff --git a/kernel-s390x-debug-fedora.config b/kernel-s390x-debug-fedora.config
index c3a6cd289..854083ff4 100644
--- a/kernel-s390x-debug-fedora.config
+++ b/kernel-s390x-debug-fedora.config
@@ -1145,7 +1145,9 @@ CONFIG_DLM=m
CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG_SG is not set
CONFIG_DMA_API_DEBUG=y
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -4241,6 +4243,7 @@ CONFIG_PWRSEQ_SIMPLE=m
# CONFIG_QCOM_EMAC is not set
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set
# CONFIG_QCS_TURING_404 is not set
diff --git a/kernel-s390x-debug-rhel.config b/kernel-s390x-debug-rhel.config
index 4bcf1d424..53518fe61 100644
--- a/kernel-s390x-debug-rhel.config
+++ b/kernel-s390x-debug-rhel.config
@@ -1020,7 +1020,8 @@ CONFIG_DLM_DEBUG=y
CONFIG_DLM=m
CONFIG_DMA_API_DEBUG_SG=y
CONFIG_DMA_API_DEBUG=y
-# CONFIG_DMABUF_HEAPS is not set
+# CONFIG_DMABUF_HEAPS_SYSTEM is not set
+CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_MOVE_NOTIFY=y
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -3887,6 +3888,7 @@ CONFIG_QCOM_FALKOR_ERRATUM_1009=y
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_IOMMU is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_PDC is not set
CONFIG_QCOM_QDF2400_ERRATUM_0065=y
diff --git a/kernel-s390x-fedora.config b/kernel-s390x-fedora.config
index cafa33868..cb0da576c 100644
--- a/kernel-s390x-fedora.config
+++ b/kernel-s390x-fedora.config
@@ -1137,7 +1137,9 @@ CONFIG_DLM=m
CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_DMA_API_DEBUG_SG is not set
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -4221,6 +4223,7 @@ CONFIG_PWRSEQ_SIMPLE=m
# CONFIG_QCOM_EMAC is not set
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set
# CONFIG_QCS_TURING_404 is not set
diff --git a/kernel-s390x-rhel.config b/kernel-s390x-rhel.config
index 6bfce9be4..8fee7620d 100644
--- a/kernel-s390x-rhel.config
+++ b/kernel-s390x-rhel.config
@@ -1012,7 +1012,8 @@ CONFIG_DLM_DEBUG=y
CONFIG_DLM=m
# CONFIG_DMA_API_DEBUG is not set
CONFIG_DMA_API_DEBUG_SG=y
-# CONFIG_DMABUF_HEAPS is not set
+# CONFIG_DMABUF_HEAPS_SYSTEM is not set
+CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_MOVE_NOTIFY=y
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -3871,6 +3872,7 @@ CONFIG_QCOM_FALKOR_ERRATUM_1009=y
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_IOMMU is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_PDC is not set
CONFIG_QCOM_QDF2400_ERRATUM_0065=y
diff --git a/kernel-s390x-zfcpdump-rhel.config b/kernel-s390x-zfcpdump-rhel.config
index 517c103de..f58f17a40 100644
--- a/kernel-s390x-zfcpdump-rhel.config
+++ b/kernel-s390x-zfcpdump-rhel.config
@@ -1022,7 +1022,8 @@ CONFIG_DLM_DEBUG=y
CONFIG_DLM=m
# CONFIG_DMA_API_DEBUG is not set
CONFIG_DMA_API_DEBUG_SG=y
-# CONFIG_DMABUF_HEAPS is not set
+# CONFIG_DMABUF_HEAPS_SYSTEM is not set
+CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_MOVE_NOTIFY=y
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -3895,6 +3896,7 @@ CONFIG_QCOM_FALKOR_ERRATUM_1009=y
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_IOMMU is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_PDC is not set
CONFIG_QCOM_QDF2400_ERRATUM_0065=y
diff --git a/kernel-x86_64-debug-fedora.config b/kernel-x86_64-debug-fedora.config
index 11d601c98..41477da36 100644
--- a/kernel-x86_64-debug-fedora.config
+++ b/kernel-x86_64-debug-fedora.config
@@ -1267,7 +1267,9 @@ CONFIG_DLM=m
CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG_SG is not set
CONFIG_DMA_API_DEBUG=y
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMA_CMA=y
@@ -4675,6 +4677,7 @@ CONFIG_PWRSEQ_SIMPLE=m
# CONFIG_QCOM_EMAC is not set
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set
# CONFIG_QCS_TURING_404 is not set
diff --git a/kernel-x86_64-debug-rhel.config b/kernel-x86_64-debug-rhel.config
index ded291224..57fcee55d 100644
--- a/kernel-x86_64-debug-rhel.config
+++ b/kernel-x86_64-debug-rhel.config
@@ -1087,7 +1087,8 @@ CONFIG_DLM_DEBUG=y
CONFIG_DLM=m
CONFIG_DMA_API_DEBUG_SG=y
CONFIG_DMA_API_DEBUG=y
-# CONFIG_DMABUF_HEAPS is not set
+# CONFIG_DMABUF_HEAPS_SYSTEM is not set
+CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_MOVE_NOTIFY=y
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -4118,6 +4119,7 @@ CONFIG_QCOM_FALKOR_ERRATUM_1009=y
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_IOMMU is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_PDC is not set
CONFIG_QCOM_QDF2400_ERRATUM_0065=y
diff --git a/kernel-x86_64-fedora.config b/kernel-x86_64-fedora.config
index 2cb91455d..7e863f11c 100644
--- a/kernel-x86_64-fedora.config
+++ b/kernel-x86_64-fedora.config
@@ -1259,7 +1259,9 @@ CONFIG_DLM=m
CONFIG_DM9102=m
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_DMA_API_DEBUG_SG is not set
-# CONFIG_DMABUF_HEAPS is not set
+CONFIG_DMABUF_HEAPS_CMA=y
+CONFIG_DMABUF_HEAPS_SYSTEM=y
+CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_MOVE_NOTIFY is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMA_CMA=y
@@ -4656,6 +4658,7 @@ CONFIG_PWRSEQ_SIMPLE=m
# CONFIG_QCOM_EMAC is not set
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set
# CONFIG_QCS_TURING_404 is not set
diff --git a/kernel-x86_64-rhel.config b/kernel-x86_64-rhel.config
index 7774905cb..110358aaf 100644
--- a/kernel-x86_64-rhel.config
+++ b/kernel-x86_64-rhel.config
@@ -1079,7 +1079,8 @@ CONFIG_DLM_DEBUG=y
CONFIG_DLM=m
# CONFIG_DMA_API_DEBUG is not set
CONFIG_DMA_API_DEBUG_SG=y
-# CONFIG_DMABUF_HEAPS is not set
+# CONFIG_DMABUF_HEAPS_SYSTEM is not set
+CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_MOVE_NOTIFY=y
# CONFIG_DMABUF_SELFTESTS is not set
# CONFIG_DMA_CMA is not set
@@ -4100,6 +4101,7 @@ CONFIG_QCOM_FALKOR_ERRATUM_1009=y
# CONFIG_QCOM_HIDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_IOMMU is not set
+# CONFIG_QCOM_IPCC is not set
# CONFIG_QCOM_OCMEM is not set
# CONFIG_QCOM_PDC is not set
CONFIG_QCOM_QDF2400_ERRATUM_0065=y
diff --git a/kernel.spec b/kernel.spec
index 65c66f01e..96191cb43 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -30,7 +30,7 @@ Summary: The Linux kernel
# For a stable, released kernel, released_kernel should be 1.
%global released_kernel 0
-%global distro_build 0.rc0.20200611gitb29482fde649.1
+%global distro_build 0.rc0.20200612gitb791d1bdf921.1
%if 0%{?fedora}
%define secure_boot_arch x86_64
@@ -69,13 +69,13 @@ Summary: The Linux kernel
%endif
%define rpmversion 5.8.0
-%define pkgrelease 0.rc0.20200611gitb29482fde649.1
+%define pkgrelease 0.rc0.20200612gitb791d1bdf921.1
# This is needed to do merge window version magic
%define patchlevel 8
# allow pkg_release to have configurable %%{?dist} tag
-%define specrelease 0.rc0.20200611gitb29482fde649.1%{?buildid}%{?dist}
+%define specrelease 0.rc0.20200612gitb791d1bdf921.1%{?buildid}%{?dist}
%define pkg_release %{specrelease}
@@ -567,7 +567,7 @@ BuildRequires: asciidoc
# exact git commit you can run
#
# xzcat -qq ${TARBALL} | git get-tar-commit-id
-Source0: linux-20200611gitb29482fde649.tar.xz
+Source0: linux-20200612gitb791d1bdf921.tar.xz
Source1: Makefile.rhelver
@@ -1280,8 +1280,8 @@ ApplyOptionalPatch()
fi
}
-%setup -q -n kernel-20200611gitb29482fde649 -c
-mv linux-20200611gitb29482fde649 linux-%{KVERREL}
+%setup -q -n kernel-20200612gitb791d1bdf921 -c
+mv linux-20200612gitb791d1bdf921 linux-%{KVERREL}
cd linux-%{KVERREL}
cp -a %{SOURCE1} .
@@ -2787,16 +2787,19 @@ fi
#
#
%changelog
-* Thu Jun 11 2020 Justin M. Forbes <jforbes@fedoraproject.org> [5.8.0-0.rc0.20200611gitb29482fde649.1]
+* Fri Jun 12 2020 Justin M. Forbes <jforbes@fedoraproject.org> [5.8.0-0.rc0.20200612gitb791d1bdf921.1]
- Fedora config updates ("Justin M. Forbes")
-* Thu Jun 11 2020 Fedora Kernel Team <kernel-team@fedoraproject.org> [5.8.0-0.rc0.20200611gitb29482fde649.1]
-- b29482fde649 rebase
-- Fix PATCHLEVEL for merge window ("Justin M. Forbes")
+* Fri Jun 12 2020 Fedora Kernel Team <kernel-team@fedoraproject.org> [5.8.0-0.rc0.20200612gitb791d1bdf921.1]
+- b791d1bdf921 rebase
- PCI: tegra: Revert raw_violation_fixup for tegra124 (Nicolas Chauvet)
+- One more Fedora config update ("Justin M. Forbes")
- Change ark CONFIG_COMMON_CLK to yes, it is selected already by other options ("Justin M. Forbes")
+- Fix PATCHLEVEL for merge window ("Justin M. Forbes")
- More module filtering for Fedora ("Justin M. Forbes")
- Update filters for rnbd in Fedora ("Justin M. Forbes")
+- redhat/Makefile.common: fix RPMKSUBLEVEL condition (Ondrej Mosnacek)
+- redhat/Makefile: silence KABI tar output (Ondrej Mosnacek)
- Fix up module filtering for 5.8 ("Justin M. Forbes")
- More Fedora config work ("Justin M. Forbes")
- RTW88BE and CE have been extracted to their own modules ("Justin M. Forbes")
diff --git a/sources b/sources
index 8526d5837..b7e23d2a1 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
-SHA512 (linux-20200611gitb29482fde649.tar.xz) = 865c1607ad71e297d93b0cb7d2614f87237d5d825c009e8dfe2cdcd14e8339d20a5fed3b76a25a7e4dffd389c85454e975d7cca54c78eb9356f617eb4346ab30
-SHA512 (kernel-abi-whitelists-5.8.0-0.rc0.20200611gitb29482fde649.1.tar.bz2) = 544594a01ad68c19a1db3a69ca7aa8ddc6dc900eb4a3710fd89d3b84079fc12b57a1877eb4e9a5fc7597ecb400c3571f5c2c8c7cac6b4d7a0ee179306b0ed043
-SHA512 (kernel-kabi-dw-5.8.0-0.rc0.20200611gitb29482fde649.1.tar.bz2) = 8891cfa7e740d30076054b6669dcdc241a9d80c0382fd5a72f3c32f324668e4e12ed396b928f9baebe5f40dd6d91c08d352a7d61a10100afb9e866bd354ffc95
+SHA512 (linux-20200612gitb791d1bdf921.tar.xz) = 3b57b00ab8352643f761b34f7e7c38398fc31d48b5705980c731606903db0780654914789b5149fab09f6dfe2a918844e31b93de4357bf2ddc4bc5e2aa5bf759
+SHA512 (kernel-abi-whitelists-5.8.0-0.rc0.20200612gitb791d1bdf921.1.tar.bz2) = 7151171a0e598a6f5e3cbc400790cfef25789a5a4d10d09aca121d5f28eeb0800a4cbcad0deb8dc34480c6ae816815f30e1e0a8c94c39321a79e186c6fdc5687
+SHA512 (kernel-kabi-dw-5.8.0-0.rc0.20200612gitb791d1bdf921.1.tar.bz2) = d989025cf7f50367bc9b7327cef7238f9cf7ecafaa6df4fa623624af23854892aefea754c7fd37523405a37179265d52167e7ae79bc1dc084319cc5f455c8eb2
an class="hl kwd">ubi_assert(len == read); if (ubi_dbg_is_bitflip(ubi)) { dbg_gen("bit-flip (emulated)"); err = UBI_IO_BITFLIPS; } } return err; } /** * ubi_io_write - write data to a physical eraseblock. * @ubi: UBI device description object * @buf: buffer with the data to write * @pnum: physical eraseblock number to write to * @offset: offset within the physical eraseblock where to write * @len: how many bytes to write * * This function writes @len bytes of data from buffer @buf to offset @offset * of physical eraseblock @pnum. If all the data were successfully written, * zero is returned. If an error occurred, this function returns a negative * error code. If %-EIO is returned, the physical eraseblock most probably went * bad. * * Note, in case of an error, it is possible that something was still written * to the flash media, but may be some garbage. */ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset, int len) { int err; size_t written; loff_t addr; dbg_io("write %d bytes to PEB %d:%d", len, pnum, offset); ubi_assert(pnum >= 0 && pnum < ubi->peb_count); ubi_assert(offset >= 0 && offset + len <= ubi->peb_size); ubi_assert(offset % ubi->hdrs_min_io_size == 0); ubi_assert(len > 0 && len % ubi->hdrs_min_io_size == 0); if (ubi->ro_mode) { ubi_err("read-only mode"); return -EROFS; } /* The below has to be compiled out if paranoid checks are disabled */ err = paranoid_check_not_bad(ubi, pnum); if (err) return err; /* The area we are writing to has to contain all 0xFF bytes */ err = ubi_dbg_check_all_ff(ubi, pnum, offset, len); if (err) return err; if (offset >= ubi->leb_start) { /* * We write to the data area of the physical eraseblock. Make * sure it has valid EC and VID headers. */ err = paranoid_check_peb_ec_hdr(ubi, pnum); if (err) return err; err = paranoid_check_peb_vid_hdr(ubi, pnum); if (err) return err; } if (ubi_dbg_is_write_failure(ubi)) { dbg_err("cannot write %d bytes to PEB %d:%d " "(emulated)", len, pnum, offset); ubi_dbg_dump_stack(); return -EIO; } addr = (loff_t)pnum * ubi->peb_size + offset; err = ubi->mtd->write(ubi->mtd, addr, len, &written, buf); if (err) { ubi_err("error %d while writing %d bytes to PEB %d:%d, written " "%zd bytes", err, len, pnum, offset, written); ubi_dbg_dump_stack(); ubi_dbg_dump_flash(ubi, pnum, offset, len); } else ubi_assert(written == len); if (!err) { err = ubi_dbg_check_write(ubi, buf, pnum, offset, len); if (err) return err; /* * Since we always write sequentially, the rest of the PEB has * to contain only 0xFF bytes. */ offset += len; len = ubi->peb_size - offset; if (len) err = ubi_dbg_check_all_ff(ubi, pnum, offset, len); } return err; } /** * erase_callback - MTD erasure call-back. * @ei: MTD erase information object. * * Note, even though MTD erase interface is asynchronous, all the current * implementations are synchronous anyway. */ static void erase_callback(struct erase_info *ei) { wake_up_interruptible((wait_queue_head_t *)ei->priv); } /** * do_sync_erase - synchronously erase a physical eraseblock. * @ubi: UBI device description object * @pnum: the physical eraseblock number to erase * * This function synchronously erases physical eraseblock @pnum and returns * zero in case of success and a negative error code in case of failure. If * %-EIO is returned, the physical eraseblock most probably went bad. */ static int do_sync_erase(struct ubi_device *ubi, int pnum) { int err, retries = 0; struct erase_info ei; wait_queue_head_t wq; dbg_io("erase PEB %d", pnum); ubi_assert(pnum >= 0 && pnum < ubi->peb_count); if (ubi->ro_mode) { ubi_err("read-only mode"); return -EROFS; } retry: init_waitqueue_head(&wq); memset(&ei, 0, sizeof(struct erase_info)); ei.mtd = ubi->mtd; ei.addr = (loff_t)pnum * ubi->peb_size; ei.len = ubi->peb_size; ei.callback = erase_callback; ei.priv = (unsigned long)&wq; err = ubi->mtd->erase(ubi->mtd, &ei); if (err) { if (retries++ < UBI_IO_RETRIES) { dbg_io("error %d while erasing PEB %d, retry", err, pnum); yield(); goto retry; } ubi_err("cannot erase PEB %d, error %d", pnum, err); ubi_dbg_dump_stack(); return err; } err = wait_event_interruptible(wq, ei.state == MTD_ERASE_DONE || ei.state == MTD_ERASE_FAILED); if (err) { ubi_err("interrupted PEB %d erasure", pnum); return -EINTR; } if (ei.state == MTD_ERASE_FAILED) { if (retries++ < UBI_IO_RETRIES) { dbg_io("error while erasing PEB %d, retry", pnum); yield(); goto retry; } ubi_err("cannot erase PEB %d", pnum); ubi_dbg_dump_stack(); return -EIO; } err = ubi_dbg_check_all_ff(ubi, pnum, 0, ubi->peb_size); if (err) return err; if (ubi_dbg_is_erase_failure(ubi)) { dbg_err("cannot erase PEB %d (emulated)", pnum); return -EIO; } return 0; } /* Patterns to write to a physical eraseblock when torturing it */ static uint8_t patterns[] = {0xa5, 0x5a, 0x0}; /** * torture_peb - test a supposedly bad physical eraseblock. * @ubi: UBI device description object * @pnum: the physical eraseblock number to test * * This function returns %-EIO if the physical eraseblock did not pass the * test, a positive number of erase operations done if the test was * successfully passed, and other negative error codes in case of other errors. */ static int torture_peb(struct ubi_device *ubi, int pnum) { int err, i, patt_count; ubi_msg("run torture test for PEB %d", pnum); patt_count = ARRAY_SIZE(patterns); ubi_assert(patt_count > 0); mutex_lock(&ubi->buf_mutex); for (i = 0; i < patt_count; i++) { err = do_sync_erase(ubi, pnum); if (err) goto out; /* Make sure the PEB contains only 0xFF bytes */ err = ubi_io_read(ubi, ubi->peb_buf1, pnum, 0, ubi->peb_size); if (err) goto out; err = ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->peb_size); if (err == 0) { ubi_err("erased PEB %d, but a non-0xFF byte found", pnum); err = -EIO; goto out; } /* Write a pattern and check it */ memset(ubi->peb_buf1, patterns[i], ubi->peb_size); err = ubi_io_write(ubi, ubi->peb_buf1, pnum, 0, ubi->peb_size); if (err) goto out; memset(ubi->peb_buf1, ~patterns[i], ubi->peb_size); err = ubi_io_read(ubi, ubi->peb_buf1, pnum, 0, ubi->peb_size); if (err) goto out; err = ubi_check_pattern(ubi->peb_buf1, patterns[i], ubi->peb_size); if (err == 0) { ubi_err("pattern %x checking failed for PEB %d", patterns[i], pnum); err = -EIO; goto out; } } err = patt_count; ubi_msg("PEB %d passed torture test, do not mark it as bad", pnum); out: mutex_unlock(&ubi->buf_mutex); if (err == UBI_IO_BITFLIPS || err == -EBADMSG) { /* * If a bit-flip or data integrity error was detected, the test * has not passed because it happened on a freshly erased * physical eraseblock which means something is wrong with it. */ ubi_err("read problems on freshly erased PEB %d, must be bad", pnum); err = -EIO; } return err; } /** * nor_erase_prepare - prepare a NOR flash PEB for erasure. * @ubi: UBI device description object * @pnum: physical eraseblock number to prepare * * NOR flash, or at least some of them, have peculiar embedded PEB erasure * algorithm: the PEB is first filled with zeroes, then it is erased. And * filling with zeroes starts from the end of the PEB. This was observed with * Spansion S29GL512N NOR flash. * * This means that in case of a power cut we may end up with intact data at the * beginning of the PEB, and all zeroes at the end of PEB. In other words, the * EC and VID headers are OK, but a large chunk of data at the end of PEB is * zeroed. This makes UBI mistakenly treat this PEB as used and associate it * with an LEB, which leads to subsequent failures (e.g., UBIFS fails). * * This function is called before erasing NOR PEBs and it zeroes out EC and VID * magic numbers in order to invalidate them and prevent the failures. Returns * zero in case of success and a negative error code in case of failure. */ static int nor_erase_prepare(struct ubi_device *ubi, int pnum) { int err, err1; size_t written; loff_t addr; uint32_t data = 0; /* * Note, we cannot generally define VID header buffers on stack, * because of the way we deal with these buffers (see the header * comment in this file). But we know this is a NOR-specific piece of * code, so we can do this. But yes, this is error-prone and we should * (pre-)allocate VID header buffer instead. */ struct ubi_vid_hdr vid_hdr; /* * It is important to first invalidate the EC header, and then the VID * header. Otherwise a power cut may lead to valid EC header and * invalid VID header, in which case UBI will treat this PEB as * corrupted and will try to preserve it, and print scary warnings (see * the header comment in scan.c for more information). */ addr = (loff_t)pnum * ubi->peb_size; err = ubi->mtd->write(ubi->mtd, addr, 4, &written, (void *)&data); if (!err) { addr += ubi->vid_hdr_aloffset; err = ubi->mtd->write(ubi->mtd, addr, 4, &written, (void *)&data); if (!err) return 0; } /* * We failed to write to the media. This was observed with Spansion * S29GL512N NOR flash. Most probably the previously eraseblock erasure * was interrupted at a very inappropriate moment, so it became * unwritable. In this case we probably anyway have garbage in this * PEB. */ err1 = ubi_io_read_vid_hdr(ubi, pnum, &vid_hdr, 0); if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR || err1 == UBI_IO_FF) { struct ubi_ec_hdr ec_hdr; err1 = ubi_io_read_ec_hdr(ubi, pnum, &ec_hdr, 0); if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR || err1 == UBI_IO_FF) /* * Both VID and EC headers are corrupted, so we can * safely erase this PEB and not afraid that it will be * treated as a valid PEB in case of an unclean reboot. */ return 0; } /* * The PEB contains a valid VID header, but we cannot invalidate it. * Supposedly the flash media or the driver is screwed up, so return an * error. */ ubi_err("cannot invalidate PEB %d, write returned %d read returned %d", pnum, err, err1); ubi_dbg_dump_flash(ubi, pnum, 0, ubi->peb_size); return -EIO; } /** * ubi_io_sync_erase - synchronously erase a physical eraseblock. * @ubi: UBI device description object * @pnum: physical eraseblock number to erase * @torture: if this physical eraseblock has to be tortured * * This function synchronously erases physical eraseblock @pnum. If @torture * flag is not zero, the physical eraseblock is checked by means of writing * different patterns to it and reading them back. If the torturing is enabled, * the physical eraseblock is erased more than once. * * This function returns the number of erasures made in case of success, %-EIO * if the erasure failed or the torturing test failed, and other negative error * codes in case of other errors. Note, %-EIO means that the physical * eraseblock is bad. */ int ubi_io_sync_erase(struct ubi_device *ubi, int pnum, int torture) { int err, ret = 0; ubi_assert(pnum >= 0 && pnum < ubi->peb_count); err = paranoid_check_not_bad(ubi, pnum); if (err != 0) return err; if (ubi->ro_mode) { ubi_err("read-only mode"); return -EROFS; } if (ubi->nor_flash) { err = nor_erase_prepare(ubi, pnum); if (err) return err; } if (torture) { ret = torture_peb(ubi, pnum); if (ret < 0) return ret; } err = do_sync_erase(ubi, pnum); if (err) return err; return ret + 1; } /** * ubi_io_is_bad - check if a physical eraseblock is bad. * @ubi: UBI device description object * @pnum: the physical eraseblock number to check * * This function returns a positive number if the physical eraseblock is bad, * zero if not, and a negative error code if an error occurred. */ int ubi_io_is_bad(const struct ubi_device *ubi, int pnum) { struct mtd_info *mtd = ubi->mtd; ubi_assert(pnum >= 0 && pnum < ubi->peb_count); if (ubi->bad_allowed) { int ret; ret = mtd->block_isbad(mtd, (loff_t)pnum * ubi->peb_size); if (ret < 0) ubi_err("error %d while checking if PEB %d is bad", ret, pnum); else if (ret) dbg_io("PEB %d is bad", pnum); return ret; } return 0; } /** * ubi_io_mark_bad - mark a physical eraseblock as bad. * @ubi: UBI device description object * @pnum: the physical eraseblock number to mark * * This function returns zero in case of success and a negative error code in * case of failure. */ int ubi_io_mark_bad(const struct ubi_device *ubi, int pnum) { int err; struct mtd_info *mtd = ubi->mtd; ubi_assert(pnum >= 0 && pnum < ubi->peb_count); if (ubi->ro_mode) { ubi_err("read-only mode"); return -EROFS; } if (!ubi->bad_allowed) return 0; err = mtd->block_markbad(mtd, (loff_t)pnum * ubi->peb_size); if (err) ubi_err("cannot mark PEB %d bad, error %d", pnum, err); return err; } /** * validate_ec_hdr - validate an erase counter header. * @ubi: UBI device description object * @ec_hdr: the erase counter header to check * * This function returns zero if the erase counter header is OK, and %1 if * not. */ static int validate_ec_hdr(const struct ubi_device *ubi, const struct ubi_ec_hdr *ec_hdr) { long long ec; int vid_hdr_offset, leb_start; ec = be64_to_cpu(ec_hdr->ec); vid_hdr_offset = be32_to_cpu(ec_hdr->vid_hdr_offset); leb_start = be32_to_cpu(ec_hdr->data_offset); if (ec_hdr->version != UBI_VERSION) { ubi_err("node with incompatible UBI version found: " "this UBI version is %d, image version is %d", UBI_VERSION, (int)ec_hdr->version); goto bad; } if (vid_hdr_offset != ubi->vid_hdr_offset) { ubi_err("bad VID header offset %d, expected %d", vid_hdr_offset, ubi->vid_hdr_offset); goto bad; } if (leb_start != ubi->leb_start) { ubi_err("bad data offset %d, expected %d", leb_start, ubi->leb_start); goto bad; } if (ec < 0 || ec > UBI_MAX_ERASECOUNTER) { ubi_err("bad erase counter %lld", ec); goto bad; } return 0; bad: ubi_err("bad EC header"); ubi_dbg_dump_ec_hdr(ec_hdr); ubi_dbg_dump_stack(); return 1; } /** * ubi_io_read_ec_hdr - read and check an erase counter header. * @ubi: UBI device description object * @pnum: physical eraseblock to read from * @ec_hdr: a &struct ubi_ec_hdr object where to store the read erase counter * header * @verbose: be verbose if the header is corrupted or was not found * * This function reads erase counter header from physical eraseblock @pnum and * stores it in @ec_hdr. This function also checks CRC checksum of the read * erase counter header. The following codes may be returned: * * o %0 if the CRC checksum is correct and the header was successfully read; * o %UBI_IO_BITFLIPS if the CRC is correct, but bit-flips were detected * and corrected by the flash driver; this is harmless but may indicate that * this eraseblock may become bad soon (but may be not); * o %UBI_IO_BAD_HDR if the erase counter header is corrupted (a CRC error); * o %UBI_IO_BAD_HDR_EBADMSG is the same as %UBI_IO_BAD_HDR, but there also was * a data integrity error (uncorrectable ECC error in case of NAND); * o %UBI_IO_FF if only 0xFF bytes were read (the PEB is supposedly empty) * o a negative error code in case of failure. */ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum, struct ubi_ec_hdr *ec_hdr, int verbose) { int err, read_err; uint32_t crc, magic, hdr_crc; dbg_io("read EC header from PEB %d", pnum); ubi_assert(pnum >= 0 && pnum < ubi->peb_count); read_err = ubi_io_read(ubi, ec_hdr, pnum, 0, UBI_EC_HDR_SIZE); if (read_err) { if (read_err != UBI_IO_BITFLIPS && read_err != -EBADMSG) return read_err; /* * We read all the data, but either a correctable bit-flip * occurred, or MTD reported a data integrity error * (uncorrectable ECC error in case of NAND). The former is * harmless, the later may mean that the read data is * corrupted. But we have a CRC check-sum and we will detect * this. If the EC header is still OK, we just report this as * there was a bit-flip, to force scrubbing. */ } magic = be32_to_cpu(ec_hdr->magic); if (magic != UBI_EC_HDR_MAGIC) { if (read_err == -EBADMSG) return UBI_IO_BAD_HDR_EBADMSG; /* * The magic field is wrong. Let's check if we have read all * 0xFF. If yes, this physical eraseblock is assumed to be * empty. */ if (ubi_check_pattern(ec_hdr, 0xFF, UBI_EC_HDR_SIZE)) { /* The physical eraseblock is supposedly empty */ if (verbose) ubi_warn("no EC header found at PEB %d, " "only 0xFF bytes", pnum); dbg_bld("no EC header found at PEB %d, " "only 0xFF bytes", pnum); if (!read_err) return UBI_IO_FF; else return UBI_IO_FF_BITFLIPS; } /* * This is not a valid erase counter header, and these are not * 0xFF bytes. Report that the header is corrupted. */ if (verbose) { ubi_warn("bad magic number at PEB %d: %08x instead of " "%08x", pnum, magic, UBI_EC_HDR_MAGIC); ubi_dbg_dump_ec_hdr(ec_hdr); } dbg_bld("bad magic number at PEB %d: %08x instead of " "%08x", pnum, magic, UBI_EC_HDR_MAGIC); return UBI_IO_BAD_HDR; } crc = crc32(UBI_CRC32_INIT, ec_hdr, UBI_EC_HDR_SIZE_CRC); hdr_crc = be32_to_cpu(ec_hdr->hdr_crc); if (hdr_crc != crc) { if (verbose) { ubi_warn("bad EC header CRC at PEB %d, calculated " "%#08x, read %#08x", pnum, crc, hdr_crc); ubi_dbg_dump_ec_hdr(ec_hdr); } dbg_bld("bad EC header CRC at PEB %d, calculated " "%#08x, read %#08x", pnum, crc, hdr_crc); if (!read_err) return UBI_IO_BAD_HDR; else return UBI_IO_BAD_HDR_EBADMSG; } /* And of course validate what has just been read from the media */ err = validate_ec_hdr(ubi, ec_hdr); if (err) { ubi_err("validation failed for PEB %d", pnum); return -EINVAL; } /* * If there was %-EBADMSG, but the header CRC is still OK, report about * a bit-flip to force scrubbing on this PEB. */ return read_err ? UBI_IO_BITFLIPS : 0; } /** * ubi_io_write_ec_hdr - write an erase counter header. * @ubi: UBI device description object * @pnum: physical eraseblock to write to * @ec_hdr: the erase counter header to write * * This function writes erase counter header described by @ec_hdr to physical * eraseblock @pnum. It also fills most fields of @ec_hdr before writing, so * the caller do not have to fill them. Callers must only fill the @ec_hdr->ec * field. * * This function returns zero in case of success and a negative error code in * case of failure. If %-EIO is returned, the physical eraseblock most probably * went bad. */ int ubi_io_write_ec_hdr(struct ubi_device *ubi, int pnum, struct ubi_ec_hdr *ec_hdr) { int err; uint32_t crc; dbg_io("write EC header to PEB %d", pnum); ubi_assert(pnum >= 0 && pnum < ubi->peb_count); ec_hdr->magic = cpu_to_be32(UBI_EC_HDR_MAGIC); ec_hdr->version = UBI_VERSION; ec_hdr->vid_hdr_offset = cpu_to_be32(ubi->vid_hdr_offset); ec_hdr->data_offset = cpu_to_be32(ubi->leb_start); ec_hdr->image_seq = cpu_to_be32(ubi->image_seq); crc = crc32(UBI_CRC32_INIT, ec_hdr, UBI_EC_HDR_SIZE_CRC); ec_hdr->hdr_crc = cpu_to_be32(crc); err = paranoid_check_ec_hdr(ubi, pnum, ec_hdr); if (err) return err; err = ubi_io_write(ubi, ec_hdr, pnum, 0, ubi->ec_hdr_alsize); return err; } /** * validate_vid_hdr - validate a volume identifier header. * @ubi: UBI device description object * @vid_hdr: the volume identifier header to check * * This function checks that data stored in the volume identifier header * @vid_hdr. Returns zero if the VID header is OK and %1 if not. */ static int validate_vid_hdr(const struct ubi_device *ubi, const struct ubi_vid_hdr *vid_hdr) { int vol_type = vid_hdr->vol_type; int copy_flag = vid_hdr->copy_flag; int vol_id = be32_to_cpu(vid_hdr->vol_id); int lnum = be32_to_cpu(vid_hdr->lnum); int compat = vid_hdr->compat; int data_size = be32_to_cpu(vid_hdr->data_size); int used_ebs = be32_to_cpu(vid_hdr->used_ebs); int data_pad = be32_to_cpu(vid_hdr->data_pad); int data_crc = be32_to_cpu(vid_hdr->data_crc); int usable_leb_size = ubi->leb_size - data_pad; if (copy_flag != 0 && copy_flag != 1) { dbg_err("bad copy_flag"); goto bad; } if (vol_id < 0 || lnum < 0 || data_size < 0 || used_ebs < 0 || data_pad < 0) { dbg_err("negative values"); goto bad; } if (vol_id >= UBI_MAX_VOLUMES && vol_id < UBI_INTERNAL_VOL_START) { dbg_err("bad vol_id"); goto bad; } if (vol_id < UBI_INTERNAL_VOL_START && compat != 0) { dbg_err("bad compat"); goto bad; } if (vol_id >= UBI_INTERNAL_VOL_START && compat != UBI_COMPAT_DELETE && compat != UBI_COMPAT_RO && compat != UBI_COMPAT_PRESERVE && compat != UBI_COMPAT_REJECT) { dbg_err("bad compat"); goto bad; } if (vol_type != UBI_VID_DYNAMIC && vol_type != UBI_VID_STATIC) { dbg_err("bad vol_type"); goto bad; } if (data_pad >= ubi->leb_size / 2) { dbg_err("bad data_pad"); goto bad; } if (vol_type == UBI_VID_STATIC) { /* * Although from high-level point of view static volumes may * contain zero bytes of data, but no VID headers can contain * zero at these fields, because they empty volumes do not have * mapped logical eraseblocks. */ if (used_ebs == 0) { dbg_err("zero used_ebs"); goto bad; } if (data_size == 0) { dbg_err("zero data_size"); goto bad; } if (lnum < used_ebs - 1) { if (data_size != usable_leb_size) { dbg_err("bad data_size"); goto bad; } } else if (lnum == used_ebs - 1) { if (data_size == 0) { dbg_err("bad data_size at last LEB"); goto bad; } } else { dbg_err("too high lnum"); goto bad; } } else { if (copy_flag == 0) { if (data_crc != 0) { dbg_err("non-zero data CRC"); goto bad; } if (data_size != 0) { dbg_err("non-zero data_size"); goto bad; } } else { if (data_size == 0) { dbg_err("zero data_size of copy"); goto bad; } } if (used_ebs != 0) { dbg_err("bad used_ebs"); goto bad; } } return 0; bad: ubi_err("bad VID header"); ubi_dbg_dump_vid_hdr(vid_hdr); ubi_dbg_dump_stack(); return 1; } /** * ubi_io_read_vid_hdr - read and check a volume identifier header. * @ubi: UBI device description object * @pnum: physical eraseblock number to read from * @vid_hdr: &struct ubi_vid_hdr object where to store the read volume * identifier header * @verbose: be verbose if the header is corrupted or wasn't found * * This function reads the volume identifier header from physical eraseblock * @pnum and stores it in @vid_hdr. It also checks CRC checksum of the read * volume identifier header. The error codes are the same as in * 'ubi_io_read_ec_hdr()'. * * Note, the implementation of this function is also very similar to * 'ubi_io_read_ec_hdr()', so refer commentaries in 'ubi_io_read_ec_hdr()'. */ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum, struct ubi_vid_hdr *vid_hdr, int verbose) { int err, read_err; uint32_t crc, magic, hdr_crc; void *p; dbg_io("read VID header from PEB %d", pnum); ubi_assert(pnum >= 0 && pnum < ubi->peb_count); p = (char *)vid_hdr - ubi->vid_hdr_shift; read_err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset, ubi->vid_hdr_alsize); if (read_err && read_err != UBI_IO_BITFLIPS && read_err != -EBADMSG) return read_err; magic = be32_to_cpu(vid_hdr->magic); if (magic != UBI_VID_HDR_MAGIC) { if (read_err == -EBADMSG) return UBI_IO_BAD_HDR_EBADMSG; if (ubi_check_pattern(vid_hdr, 0xFF, UBI_VID_HDR_SIZE)) { if (verbose) ubi_warn("no VID header found at PEB %d, " "only 0xFF bytes", pnum); dbg_bld("no VID header found at PEB %d, " "only 0xFF bytes", pnum); if (!read_err) return UBI_IO_FF; else return UBI_IO_FF_BITFLIPS; } if (verbose) { ubi_warn("bad magic number at PEB %d: %08x instead of " "%08x", pnum, magic, UBI_VID_HDR_MAGIC); ubi_dbg_dump_vid_hdr(vid_hdr); } dbg_bld("bad magic number at PEB %d: %08x instead of " "%08x", pnum, magic, UBI_VID_HDR_MAGIC); return UBI_IO_BAD_HDR; } crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_VID_HDR_SIZE_CRC); hdr_crc = be32_to_cpu(vid_hdr->hdr_crc); if (hdr_crc != crc) { if (verbose) { ubi_warn("bad CRC at PEB %d, calculated %#08x, " "read %#08x", pnum, crc, hdr_crc); ubi_dbg_dump_vid_hdr(vid_hdr); } dbg_bld("bad CRC at PEB %d, calculated %#08x, " "read %#08x", pnum, crc, hdr_crc); if (!read_err) return UBI_IO_BAD_HDR; else return UBI_IO_BAD_HDR_EBADMSG; } err = validate_vid_hdr(ubi, vid_hdr); if (err) { ubi_err("validation failed for PEB %d", pnum); return -EINVAL; } return read_err ? UBI_IO_BITFLIPS : 0; } /** * ubi_io_write_vid_hdr - write a volume identifier header. * @ubi: UBI device description object * @pnum: the physical eraseblock number to write to * @vid_hdr: the volume identifier header to write * * This function writes the volume identifier header described by @vid_hdr to * physical eraseblock @pnum. This function automatically fills the * @vid_hdr->magic and the @vid_hdr->version fields, as well as calculates * header CRC checksum and stores it at vid_hdr->hdr_crc. * * This function returns zero in case of success and a negative error code in * case of failure. If %-EIO is returned, the physical eraseblock probably went * bad. */ int ubi_io_write_vid_hdr(struct ubi_device *ubi, int pnum, struct ubi_vid_hdr *vid_hdr) { int err; uint32_t crc; void *p; dbg_io("write VID header to PEB %d", pnum); ubi_assert(pnum >= 0 && pnum < ubi->peb_count); err = paranoid_check_peb_ec_hdr(ubi, pnum); if (err) return err; vid_hdr->magic = cpu_to_be32(UBI_VID_HDR_MAGIC); vid_hdr->version = UBI_VERSION; crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_VID_HDR_SIZE_CRC); vid_hdr->hdr_crc = cpu_to_be32(crc); err = paranoid_check_vid_hdr(ubi, pnum, vid_hdr); if (err) return err; p = (char *)vid_hdr - ubi->vid_hdr_shift; err = ubi_io_write(ubi, p, pnum, ubi->vid_hdr_aloffset, ubi->vid_hdr_alsize); return err; } #ifdef CONFIG_MTD_UBI_DEBUG /** * paranoid_check_not_bad - ensure that a physical eraseblock is not bad. * @ubi: UBI device description object * @pnum: physical eraseblock number to check * * This function returns zero if the physical eraseblock is good, %-EINVAL if * it is bad and a negative error code if an error occurred. */ static int paranoid_check_not_bad(const struct ubi_device *ubi, int pnum) { int err; if (!ubi->dbg->chk_io) return 0; err = ubi_io_is_bad(ubi, pnum); if (!err) return err; ubi_err("paranoid check failed for PEB %d", pnum); ubi_dbg_dump_stack(); return err > 0 ? -EINVAL : err; } /** * paranoid_check_ec_hdr - check if an erase counter header is all right. * @ubi: UBI device description object * @pnum: physical eraseblock number the erase counter header belongs to * @ec_hdr: the erase counter header to check * * This function returns zero if the erase counter header contains valid * values, and %-EINVAL if not. */ static int paranoid_check_ec_hdr(const struct ubi_device *ubi, int pnum, const struct ubi_ec_hdr *ec_hdr) { int err; uint32_t magic; if (!ubi->dbg->chk_io) return 0; magic = be32_to_cpu(ec_hdr->magic); if (magic != UBI_EC_HDR_MAGIC) { ubi_err("bad magic %#08x, must be %#08x", magic, UBI_EC_HDR_MAGIC); goto fail; } err = validate_ec_hdr(ubi, ec_hdr); if (err) { ubi_err("paranoid check failed for PEB %d", pnum); goto fail; } return 0; fail: ubi_dbg_dump_ec_hdr(ec_hdr); ubi_dbg_dump_stack(); return -EINVAL; } /** * paranoid_check_peb_ec_hdr - check erase counter header. * @ubi: UBI device description object * @pnum: the physical eraseblock number to check * * This function returns zero if the erase counter header is all right and and * a negative error code if not or if an error occurred. */ static int paranoid_check_peb_ec_hdr(const struct ubi_device *ubi, int pnum) { int err; uint32_t crc, hdr_crc; struct ubi_ec_hdr *ec_hdr; if (!ubi->dbg->chk_io) return 0; ec_hdr = kzalloc(ubi->ec_hdr_alsize, GFP_NOFS); if (!ec_hdr) return -ENOMEM; err = ubi_io_read(ubi, ec_hdr, pnum, 0, UBI_EC_HDR_SIZE); if (err && err != UBI_IO_BITFLIPS && err != -EBADMSG) goto exit; crc = crc32(UBI_CRC32_INIT, ec_hdr, UBI_EC_HDR_SIZE_CRC); hdr_crc = be32_to_cpu(ec_hdr->hdr_crc); if (hdr_crc != crc) { ubi_err("bad CRC, calculated %#08x, read %#08x", crc, hdr_crc); ubi_err("paranoid check failed for PEB %d", pnum); ubi_dbg_dump_ec_hdr(ec_hdr); ubi_dbg_dump_stack(); err = -EINVAL; goto exit; } err = paranoid_check_ec_hdr(ubi, pnum, ec_hdr); exit: kfree(ec_hdr); return err; } /** * paranoid_check_vid_hdr - check that a volume identifier header is all right. * @ubi: UBI device description object * @pnum: physical eraseblock number the volume identifier header belongs to * @vid_hdr: the volume identifier header to check * * This function returns zero if the volume identifier header is all right, and * %-EINVAL if not. */ static int paranoid_check_vid_hdr(const struct ubi_device *ubi, int pnum, const struct ubi_vid_hdr *vid_hdr) { int err; uint32_t magic; if (!ubi->dbg->chk_io) return 0; magic = be32_to_cpu(vid_hdr->magic); if (magic != UBI_VID_HDR_MAGIC) { ubi_err("bad VID header magic %#08x at PEB %d, must be %#08x", magic, pnum, UBI_VID_HDR_MAGIC); goto fail; } err = validate_vid_hdr(ubi, vid_hdr); if (err) { ubi_err("paranoid check failed for PEB %d", pnum); goto fail; } return err; fail: ubi_err("paranoid check failed for PEB %d", pnum); ubi_dbg_dump_vid_hdr(vid_hdr); ubi_dbg_dump_stack(); return -EINVAL; } /** * paranoid_check_peb_vid_hdr - check volume identifier header. * @ubi: UBI device description object * @pnum: the physical eraseblock number to check * * This function returns zero if the volume identifier header is all right, * and a negative error code if not or if an error occurred. */ static int paranoid_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum) { int err; uint32_t crc, hdr_crc; struct ubi_vid_hdr *vid_hdr; void *p; if (!ubi->dbg->chk_io) return 0; vid_hdr = ubi_zalloc_vid_hdr(ubi, GFP_NOFS); if (!vid_hdr) return -ENOMEM; p = (char *)vid_hdr - ubi->vid_hdr_shift; err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset, ubi->vid_hdr_alsize); if (err && err != UBI_IO_BITFLIPS && err != -EBADMSG) goto exit; crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_EC_HDR_SIZE_CRC); hdr_crc = be32_to_cpu(vid_hdr->hdr_crc); if (hdr_crc != crc) { ubi_err("bad VID header CRC at PEB %d, calculated %#08x, " "read %#08x", pnum, crc, hdr_crc); ubi_err("paranoid check failed for PEB %d", pnum); ubi_dbg_dump_vid_hdr(vid_hdr); ubi_dbg_dump_stack(); err = -EINVAL; goto exit; } err = paranoid_check_vid_hdr(ubi, pnum, vid_hdr); exit: ubi_free_vid_hdr(ubi, vid_hdr); return err; } /** * ubi_dbg_check_write - make sure write succeeded. * @ubi: UBI device description object * @buf: buffer with data which were written * @pnum: physical eraseblock number the data were written to * @offset: offset within the physical eraseblock the data were written to * @len: how many bytes were written * * This functions reads data which were recently written and compares it with * the original data buffer - the data have to match. Returns zero if the data * match and a negative error code if not or in case of failure. */ int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum, int offset, int len) { int err, i; size_t read; void *buf1; loff_t addr = (loff_t)pnum * ubi->peb_size + offset; if (!ubi->dbg->chk_io) return 0; buf1 = __vmalloc(len, GFP_NOFS, PAGE_KERNEL); if (!buf1) { ubi_err("cannot allocate memory to check writes"); return 0; } err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf1); if (err && err != -EUCLEAN) goto out_free; for (i = 0; i < len; i++) { uint8_t c = ((uint8_t *)buf)[i]; uint8_t c1 = ((uint8_t *)buf1)[i]; int dump_len; if (c == c1) continue; ubi_err("paranoid check failed for PEB %d:%d, len %d", pnum, offset, len); ubi_msg("data differ at position %d", i); dump_len = max_t(int, 128, len - i); ubi_msg("hex dump of the original buffer from %d to %d", i, i + dump_len); print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, buf + i, dump_len, 1); ubi_msg("hex dump of the read buffer from %d to %d", i, i + dump_len); print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, buf1 + i, dump_len, 1); ubi_dbg_dump_stack(); err = -EINVAL; goto out_free; } vfree(buf1); return 0; out_free: vfree(buf1); return err; } /** * ubi_dbg_check_all_ff - check that a region of flash is empty. * @ubi: UBI device description object * @pnum: the physical eraseblock number to check * @offset: the starting offset within the physical eraseblock to check * @len: the length of the region to check * * This function returns zero if only 0xFF bytes are present at offset * @offset of the physical eraseblock @pnum, and a negative error code if not * or if an error occurred. */ int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len) { size_t read; int err; void *buf; loff_t addr = (loff_t)pnum * ubi->peb_size + offset; if (!ubi->dbg->chk_io) return 0; buf = __vmalloc(len, GFP_NOFS, PAGE_KERNEL); if (!buf) { ubi_err("cannot allocate memory to check for 0xFFs"); return 0; } err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf); if (err && err != -EUCLEAN) { ubi_err("error %d while reading %d bytes from PEB %d:%d, " "read %zd bytes", err, len, pnum, offset, read); goto error; } err = ubi_check_pattern(buf, 0xFF, len); if (err == 0) { ubi_err("flash region at PEB %d:%d, length %d does not " "contain all 0xFF bytes", pnum, offset, len); goto fail; } vfree(buf); return 0; fail: ubi_err("paranoid check failed for PEB %d", pnum); ubi_msg("hex dump of the %d-%d region", offset, offset + len); print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, buf, len, 1); err = -EINVAL; error: ubi_dbg_dump_stack(); vfree(buf); return err; } #endif /* CONFIG_MTD_UBI_DEBUG */