openwrt/target/linux/generic/pending-5.4
Michal Cieslakiewicz e2b89ea069 kernel: generic: 5.4: fix mtd concat panic on read/write functions
Commit 2431c4f5b46c32c4ac495456b1ef4ce59c0bb85d ("mtd: Implement
mtd_{read,write}() as wrappers around mtd_{read,write}_oob()") for kernel 5.4
restrict mtd devices to register only one type of read/write functions
(either generic or OOB).

mtd concat does not follow above rule and defines both methods at the same
time, causing this type of device to be rejected by kernel. For routers that
use mtd concat for root UBI volume that means kernel panic and boot loop with
following error:

[    0.767307] Creating 1 MTD partitions on "ubi-concat":
[    0.772547] 0x000000000000-0x000007500000 : "ubi"
[    0.777953] ------------[ cut here ]------------
[    0.782683] WARNING: CPU: 0 PID: 1 at drivers/mtd/mtdcore.c:621 add_mtd_device+0x84/0x5f4
[    0.790983] Modules linked in:
[    0.794093] CPU: 0 PID: 1 Comm: swapper Not tainted 5.4.24 #0
[    0.799932] Stack : 80680000 8062af20 00000000 00000000 8062a0f0 87c2dae4 87c282fc 8065fd23
[    0.808430]         805c64f4 00000001 807b32d8 80670000 80670000 00000001 87c2da98 25c15bcb
[    0.816909]         00000000 00000000 807e0000 0000006e 61696e74 00000000 2e342e32 34202330
[    0.825397]         0000006e cef2ada7 00000000 000c1ded 00000000 00000009 00000000 8034de64
[    0.833889]         00000009 80670000 80670000 80676d18 00000000 80320044 00000000 807b0000
[    0.842381]         ...
[    0.844861] Call Trace:
[    0.847367] [<80069994>] show_stack+0x30/0x100
[    0.851913] [<8007e8ac>] __warn+0xc0/0x10c
[    0.856072] [<8007e954>] warn_slowpath_fmt+0x5c/0xac
[    0.861134] [<8034de64>] add_mtd_device+0x84/0x5f4
[    0.866001] [<80352a50>] add_mtd_partitions+0xd8/0x1b8
[    0.871231] [<803527b8>] parse_mtd_partitions+0x238/0x3f8
[    0.876717] [<8034e51c>] mtd_device_parse_register+0x48/0x1b0
[    0.882586] [<8038dd2c>] virt_concat_probe+0x170/0x1ec
[    0.887820] [<803334c8>] platform_drv_probe+0x40/0x94
[    0.892970] [<80331638>] really_probe+0x104/0x35c
[    0.897766] [<80331d54>] device_driver_attach+0x70/0x98
[    0.903072] [<80331ddc>] __driver_attach+0x60/0x100
[    0.908042] [<8032f668>] bus_for_each_dev+0x68/0xa4
[    0.912989] [<803309d4>] bus_add_driver+0x1f0/0x200
[    0.917952] [<80332448>] driver_register+0x84/0x148
[    0.922906] [<80060a1c>] do_one_initcall+0x7c/0x1dc
[    0.927870] [<80684e14>] kernel_init_freeable+0x158/0x23c
[    0.933361] [<805387d8>] kernel_init+0x10/0xf0
[    0.937883] [<80064dd8>] ret_from_kernel_thread+0x14/0x1c
[    0.943375] ---[ end trace 62e0927fba490f68 ]---
[...]
[    2.266513] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    2.274893] Rebooting in 1 seconds..

This patch makes mtd concat to follow new mtd requirements by registering
either normal or oob versions of read/write functions, but not both at the
same time. OOB is used only when underlying mtd devices provide such
functionality (like NAND chips) - otherwise generic methods are used.

Tested successfully on Netgear WNDR4300.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2020-03-29 16:23:57 +02:00
..
102-MIPS-only-process-negative-stack-offsets-on-stack-tr.patch kernel: copy kernel 4.19 code to 5.4 2020-02-28 17:50:45 +01:00
110-ehci_hcd_ignore_oc.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
130-add-linux-spidev-compatible-si3210.patch kernel: bump 5.4 to 5.4.28 2020-03-28 13:03:02 +01:00
140-jffs2-use-.rename2-and-add-RENAME_WHITEOUT-support.patch kernel: copy kernel 4.19 code to 5.4 2020-02-28 17:50:45 +01:00
141-jffs2-add-RENAME_EXCHANGE-support.patch kernel: copy kernel 4.19 code to 5.4 2020-02-28 17:50:45 +01:00
150-bridge_allow_receiption_on_disabled_port.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
180-net-phy-at803x-add-support-for-AT8032.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
201-extra_optimization.patch kernel: bump 5.4 to 5.4.24 2020-03-09 20:43:53 +01:00
203-kallsyms_uncompressed.patch kernel: bump 5.4 to 5.4.24 2020-03-09 20:43:53 +01:00
205-backtrace_module_info.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
240-remove-unsane-filenames-from-deps_initramfs-list.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
261-enable_wilink_platform_without_drivers.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
300-mips_expose_boot_raw.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
302-mips_no_branch_likely.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
305-mips_module_reloc.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
306-mips_mem_functions_performance.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
307-mips_highmem_offset.patch kernel: copy kernel 4.19 code to 5.4 2020-02-28 17:50:45 +01:00
308-mips32r2_tune.patch kernel: copy kernel 4.19 code to 5.4 2020-02-28 17:50:45 +01:00
309-MIPS-Add-CPU-option-reporting-to-proc-cpuinfo.patch kernel: copy kernel 4.19 code to 5.4 2020-02-28 17:50:45 +01:00
310-arm_module_unresolved_weak_sym.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
330-MIPS-kexec-Accept-command-line-parameters-from-users.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
332-arc-add-OWRTDTB-section.patch kernel: update arc-specific patch 2020-03-29 16:05:30 +02:00
333-arc-enable-unaligned-access-in-kernel-mode.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
342-powerpc-Enable-kernel-XZ-compression-option-on-PPC_8.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
400-mtd-add-rootfs-split-support.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
401-mtd-add-support-for-different-partition-parser-types.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
403-mtd-hook-mtdsplit-to-Kbuild.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
404-mtd-add-more-helper-functions.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
411-mtd-partial_eraseblock_write.patch kernel: backport mtd partition address fix sent upstream 2020-03-09 11:49:42 +01:00
412-mtd-partial_eraseblock_unlock.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
419-mtd-redboot-add-of_match_table-with-DT-binding.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
420-mtd-redboot_space.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
430-mtd-add-myloader-partition-parser.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
432-mtd-bcm47xxpart-detect-T_Meter-partition.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
440-block2mtd_init.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
441-block2mtd_probe.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
450-mtd-spi-nor-allow-NOR-driver-to-write-fewer-bytes-th.patch generic: 5.4: Add 4B_OPCODES flag to w25q256 2020-03-12 12:59:44 +01:00
460-mtd-cfi_cmdset_0002-no-erase_suspend.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
465-m25p80-mx-disable-software-protection.patch generic: 5.4: Add 4B_OPCODES flag to w25q256 2020-03-12 12:59:44 +01:00
466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch generic: 5.4: Add 4B_OPCODES flag to w25q256 2020-03-12 12:59:44 +01:00
470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch generic: 5.4: Add 4B_OPCODES flag to w25q256 2020-03-12 12:59:44 +01:00
476-mtd-spi-nor-add-eon-en25q128.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
479-mtd-spi-nor-add-xtx-xt25f128b.patch generic: 5.4: Add 4B_OPCODES flag to w25q256 2020-03-12 12:59:44 +01:00
480-mtd-set-rootfs-to-be-root-dev.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
491-ubi-auto-create-ubiblock-device-for-rootfs.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
494-mtd-ubi-add-EOF-marker-support.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
495-mtd-core-add-get_mtd_device_by_node.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
496-dt-bindings-add-bindings-for-mtd-concat-devices.patch kernel: copy kernel 4.19 code to 5.4 2020-02-28 17:50:45 +01:00
497-mtd-mtdconcat-add-dt-driver-for-concat-devices.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
498-mtd-mtdconcat-select-readwrite-function.patch kernel: generic: 5.4: fix mtd concat panic on read/write functions 2020-03-29 16:23:57 +02:00
530-jffs2_make_lzma_available.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
532-jffs2_eofdetect.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
600-netfilter_conntrack_flush.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
610-netfilter_match_bypass_default_checks.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
611-netfilter_match_bypass_default_table.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
612-netfilter_match_reduce_memory_access.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
613-netfilter_optional_tcp_window_check.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
616-net_optimize_xfrm_calls.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
620-net_sched-codel-do-not-defer-queue-length-update.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
630-packet_socket_type.patch kernel: bump 5.4 to 5.4.28 2020-03-28 13:03:02 +01:00
640-netfilter-nf_flow_table-add-hardware-offload-support.patch kernel: bump 5.4 to 5.4.28 2020-03-28 13:03:02 +01:00
641-netfilter-nf_flow_table-support-hw-offload-through-v.patch kernel: bump 5.4 to 5.4.24 2020-03-09 20:43:53 +01:00
642-net-8021q-support-hardware-flow-table-offload.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
643-net-bridge-support-hardware-flow-table-offload.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
644-net-pppoe-support-hardware-flow-table-offload.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
645-netfilter-nf_flow_table-rework-hardware-offload-time.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
646-netfilter-nf_flow_table-rework-private-driver-data.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
655-increase_skb_pad.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
666-Add-support-for-MAP-E-FMRs-mesh-mode.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
670-ipv6-allow-rejecting-with-source-address-failed-policy.patch kernel: bump 5.4 to 5.4.24 2020-03-09 20:43:53 +01:00
671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
680-NET-skip-GRO-for-foreign-MAC-addresses.patch kernel: bump 5.4 to 5.4.24 2020-03-09 20:43:53 +01:00
681-NET-add-of_get_mac_address_mtd.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
703-phy-add-detach-callback-to-struct-phy_driver.patch kernel: bump 5.4 to 5.4.28 2020-03-28 13:03:02 +01:00
735-net-phy-at803x-fix-at8033-sgmii-mode.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
739-net-avoid-tx-fault-with-Nokia-GPON-module.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
740-net-sfp-remove-incomplete-100BASE-FX-and-100BASE-LX-.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
741-net-sfp-derive-interface-mode-from-ethtool-link-mode.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
742-net-sfp-add-more-extended-compliance-codes.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
743-net-sfp-add-module-start-stop-upstream-notifications.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
744-net-sfp-move-phy_start-phy_stop-to-phylink.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
745-net-mdio-i2c-add-support-for-Clause-45-accesses.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
746-net-phylink-re-split-__phylink_connect_phy.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
747-net-phylink-support-Clause-45-PHYs-on-SFP-modules.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
748-net-phylink-split-link_an_mode-configured-and-curren.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
749-net-phylink-split-phylink_sfp_module_insert.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
750-net-phylink-delay-MAC-configuration-for-copper-SFP-m.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
751-net-phylink-make-Broadcom-BCM84881-based-SFPs-work.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
752-net-phy-add-Broadcom-BCM84881-PHY-driver.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
753-net-sfp-add-support-for-Clause-45-PHYs.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
754-net-sfp-fix-unbind.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
755-net-sfp-fix-hwmon.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
756-net-sfp-use-a-definition-for-the-fault-recovery-atte.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
757-net-sfp-rename-sm_retries.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
758-net-sfp-error-handling-for-phy-probe.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
759-net-sfp-re-attempt-probing-for-phy.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch kernel: copy kernel 4.19 code to 5.4 2020-02-28 17:50:45 +01:00
810-pci_disable_common_quirks.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
811-pci_disable_usb_common_quirks.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
820-libata-Assign-OF-node-to-the-SCSI-device.patch kernel: backport and package drivetemp hwmon from v5.5 2020-03-21 17:48:34 +01:00
834-ledtrig-libata.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00
920-mangle_bootargs.patch kernel: bump 5.4 to 5.4.24 2020-03-09 20:43:53 +01:00
0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch kernel: add support for kernel 5.4 2020-02-28 17:50:45 +01:00