There is a silly workaround for this problem: Rebooting or powering off the device doesn't fix the issue but when I remove the SD card and put it inside the card reader and just open it with Ubuntu and then eject it and put it back in the device, the problem has gone! I've tested that a few times and this is the only way I could get rid of the problem. The new logs after the problem is gone are attached to this post and the next one:
root@LEDE:~# cat dmesg2.log
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.4.140 (buildbot@builds-02.infra.lede-project.org) (gcc version 5.4.0 (LEDE GCC 5.4.0 r3103-1b51a49) ) #0 SMP Fri Jul 13 19:25:14 2018
[ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: Raspberry Pi 3 Model B Rev 1.2
[ 0.000000] cma: Reserved 16 MiB at 0x3a000000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 241664
[ 0.000000] free_area_init_node: node 0, pgdat 804f7000, node_mem_map b988e000
[ 0.000000] Normal zone: 1888 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 241664 pages, LIFO batch:31
[ 0.000000] [bcm2709_smp_init_cpus] enter (9480->f3003010)
[ 0.000000] [bcm2709_smp_init_cpus] ncores=4
[ 0.000000] PERCPU: Embedded 12 pages/cpu @b984e000 s17856 r8192 d23104 u49152
[ 0.000000] pcpu-alloc: s17856 r8192 d23104 u49152 alloc=12*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 239776
[ 0.000000] Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:1E:DA:BE vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 936020K/966656K available (4119K kernel code, 135K rwdata, 684K rodata, 224K init, 373K bss, 14252K reserved, 16384K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xbb800000 - 0xff800000 (1088 MB)
[ 0.000000] lowmem : 0x80000000 - 0xbb000000 ( 944 MB)
[ 0.000000] modules : 0x7f000000 - 0x80000000 ( 16 MB)
[ 0.000000] .text : 0x80008000 - 0x804b9148 (4805 kB)
[ 0.000000] .init : 0x804ba000 - 0x804f2000 ( 224 kB)
[ 0.000000] .data : 0x804f2000 - 0x80513d88 ( 136 kB)
[ 0.000000] .bss : 0x80513d88 - 0x805713f8 ( 374 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] Architected cp15 timer(s) running at 19.20MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[ 0.000009] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[ 0.000024] Switching to timer-based delay loop, resolution 52ns
[ 0.000201] Console: colour dummy device 80x30
[ 0.000826] console [tty1] enabled
[ 0.000870] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[ 0.000925] pid_max: default: 32768 minimum: 301
[ 0.001059] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.001092] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.001784] CPU: Testing write buffer coherency: ok
[ 0.002205] CPU0: update cpu_capacity 1024
[ 0.002235] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.002262] [bcm2709_smp_prepare_cpus] enter
[ 0.002330] Setting up static identity map for 0x8240 - 0x8298
[ 0.003443] [bcm2709_boot_secondary] cpu:1 started (0) 18
[ 0.003634] [bcm2709_secondary_init] enter cpu:1
[ 0.003668] CPU1: update cpu_capacity 1024
[ 0.003674] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.003985] [bcm2709_boot_secondary] cpu:2 started (0) 17
[ 0.004124] [bcm2709_secondary_init] enter cpu:2
[ 0.004144] CPU2: update cpu_capacity 1024
[ 0.004150] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[ 0.004437] [bcm2709_boot_secondary] cpu:3 started (0) 16
[ 0.004567] [bcm2709_secondary_init] enter cpu:3
[ 0.004587] CPU3: update cpu_capacity 1024
[ 0.004592] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[ 0.004645] Brought up 4 CPUs
[ 0.004735] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[ 0.004761] CPU: All CPU(s) started in HYP mode.
[ 0.004785] CPU: Virtualization extensions available.
[ 0.013527] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[ 0.013782] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.013838] futex hash table entries: 1024 (order: 4, 65536 bytes)
[ 0.014465] pinctrl core: initialized pinctrl subsystem
[ 0.015037] NET: Registered protocol family 16
[ 0.019980] DMA: preallocated 4096 KiB pool for atomic coherent allocations
[ 0.049939] cpuidle: using governor ladder
[ 0.079958] cpuidle: using governor menu
[ 0.085746] bcm2709: Mini UART enabled
[ 0.085828] Serial: AMBA PL011 UART driver
[ 0.085970] uart-pl011 3f201000.uart: could not find pctldev for node /soc/gpio@7e200000/uart0_pins, deferring probe
[ 0.086139] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[ 0.141991] bcm2835-dma 3f007000.dma: DMA legacy API manager at f3007000, dmachans=0x1
[ 0.142411] SCSI subsystem initialized
[ 0.142583] usbcore: registered new interface driver usbfs
[ 0.142680] usbcore: registered new interface driver hub
[ 0.142764] usbcore: registered new device driver usb
[ 0.150038] raspberrypi-firmware soc:firmware: Attached to firmware from 2017-03-02 15:32
[ 0.176864] clocksource: Switched to clocksource arch_sys_counter
[ 0.184436] NET: Registered protocol family 2
[ 0.185072] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.185209] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.185416] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.185520] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 0.185585] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 0.185770] NET: Registered protocol family 1
[ 0.187247] Crashlog allocated RAM at address 0x3f00000
[ 0.196015] io scheduler noop registered
[ 0.196045] io scheduler deadline registered
[ 0.196094] io scheduler cfq registered (default)
[ 0.198474] BCM2708FB: allocated DMA memory fa410000
[ 0.198519] BCM2708FB: allocated DMA channel 0 @ f3007000
[ 0.243730] Console: switching to colour frame buffer device 228x61
[ 0.268618] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[ 0.269612] console [ttyS0] disabled
[ 0.269744] 3f215040.uart: ttyS0 at MMIO 0x3f215040 (irq = 59, base_baud = 31250000) is a 16550
[ 0.862015] console [ttyS0] enabled
[ 0.866232] vc-cma: Videocore CMA driver
[ 0.870316] vc-cma: vc_cma_base = 0x00000000
[ 0.875196] vc-cma: vc_cma_size = 0x00000000 (0 MiB)
[ 0.880807] vc-cma: vc_cma_initial = 0x00000000 (0 MiB)
[ 0.886546] vc-mem: phys_addr:0x00000000 mem_base=0x3dc00000 mem_size:0x3f000000(1008 MiB)
[ 0.906272] brd: module loaded
[ 0.916272] loop: module loaded
[ 0.920383] vchiq: vchiq_init_state: slot_zero = 0xba480000, is_master = 0
[ 0.929243] usbcore: registered new interface driver smsc95xx
[ 0.935236] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 1.141491] Core Release: 2.80a
[ 1.144761] Setting default values for core params
[ 1.149768] Finished setting default values for core params
[ 1.355835] Using Buffer DMA mode
[ 1.359290] Periodic Transfer Interrupt Enhancement - disabled
[ 1.365339] Multiprocessor Interrupt Enhancement - disabled
[ 1.371124] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 1.375651] Dedicated Tx FIFOs mode
[ 1.379558] WARN::dwc_otg_hcd_init:1047: FIQ DMA bounce buffers: virt = 0xba404000 dma = 0xfa404000 len=9024
[ 1.389789] FIQ FSM acceleration enabled for :
[ 1.389789] Non-periodic Split Transactions
[ 1.389789] Periodic Split Transactions
[ 1.389789] High-Speed Isochronous Endpoints
[ 1.389789] Interrupt/Control Split Transaction hack enabled
[ 1.430407] dwc_otg: Microframe scheduler enabled
[ 1.430457] WARN::hcd_init_fiq:415: FIQ on core 1 at 0x802aa31c
[ 1.442424] WARN::hcd_init_fiq:416: FIQ ASM at 0x8000ee40 length 36
[ 1.454759] WARN::hcd_init_fiq:441: MPHI regs_base at 0xbb87a000
[ 1.466825] dwc_otg 3f980000.usb: DWC OTG Controller
[ 1.477794] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[ 1.491050] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000
[ 1.502588] Init: Port Power? op_state=1
[ 1.512397] Init: Power Port (0)
[ 1.521536] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.534397] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.547735] usb usb1: Product: DWC OTG Controller
[ 1.558349] usb usb1: Manufacturer: Linux 4.4.140 dwc_otg_hcd
[ 1.570076] usb usb1: SerialNumber: 3f980000.usb
[ 1.581221] hub 1-0:1.0: USB hub found
[ 1.590743] hub 1-0:1.0: 1 port detected
[ 1.601012] dwc_otg: FIQ enabled
[ 1.601021] dwc_otg: NAK holdoff enabled
[ 1.601028] dwc_otg: FIQ split-transaction FSM enabled
[ 1.601043] Module dwc_common_port init
[ 1.601224] usbcore: registered new interface driver uas
[ 1.612438] usbcore: registered new interface driver usb-storage
[ 1.624208] mousedev: PS/2 mouse device common for all mice
[ 1.636249] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[ 1.649038] sdhci: Secure Digital Host Controller Interface driver
[ 1.660938] sdhci: Copyright(c) Pierre Ossman
[ 1.671171] sdhost: log_buf @ ba407000 (fa407000)
[ 1.736879] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[ 1.750376] mmc-bcm2835 3f300000.mmc: mmc_debug:0 mmc_debug2:0
[ 1.762072] mmc-bcm2835 3f300000.mmc: DMA channel allocated
[ 1.794265] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.806947] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.808392] Indeed it is in host mode hprt0 = 00021501
[ 1.808602] NET: Registered protocol family 10
[ 1.843643] mmc0: new high speed SDHC card at address 59b4
[ 1.843836] NET: Registered protocol family 17
[ 1.843886] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[ 1.843890] 8021q: 802.1Q VLAN Support v1.8
[ 1.844257] Registering SWP/SWPB emulation handler
[ 1.844806] vc-sm: Videocore shared memory driver
[ 1.844815] [vc_sm_connected_init]: start
[ 1.845217] [vc_sm_connected_init]: end - returning 0
[ 1.846458] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[ 1.846808] of_cfs_init
[ 1.846901] of_cfs_init: OK
[ 1.969255] Waiting for root device /dev/mmcblk0p2...
[ 1.969648] mmcblk0: mmc0:59b4 68BHO 29.8 GiB
[ 1.981578] mmcblk0: p1 p2
[ 1.986906] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 1.987054] Indeed it is in host mode hprt0 = 00001101
[ 2.000041] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[ 2.001574] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.003099] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.005847] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[ 2.072886] EXT4-fs (mmcblk0p2): mounted filesystem without journal. Opts: (null)
[ 2.086390] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 2.094264] mmc1: new high speed SDIO card at address 0001
[ 2.110589] Freeing unused kernel memory: 224K
[ 2.182449] init: Console is alive
[ 2.187229] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[ 2.187238] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.187927] hub 1-1:1.0: USB hub found
[ 2.188006] hub 1-1:1.0: 5 ports detected
[ 2.236979] init: - watchdog -
[ 2.347250] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[ 2.362300] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[ 2.377139] init: - preinit -
[ 2.466936] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[ 2.577116] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[ 2.590103] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.605604] random: procd: uninitialized urandom read (4 bytes read, 65 bits of entropy available)
[ 2.621188] smsc95xx v1.0.4
[ 2.689877] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:1e:da:be
[ 2.786880] usb 1-1.5: new low-speed USB device number 4 using dwc_otg
[ 2.932342] usb 1-1.5: New USB device found, idVendor=046d, idProduct=c31d
[ 2.945796] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2.959636] usb 1-1.5: Product: USB Keyboard
[ 2.970335] usb 1-1.5: Manufacturer: Logitech
[ 4.525297] mount_root: mounting /dev/root
[ 4.536383] EXT4-fs (mmcblk0p2): warning: mounting unchecked fs, running e2fsck is recommended
[ 4.558256] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 4.606249] urandom-seed: Seeding with /etc/urandom.seed
[ 4.640751] procd: - early -
[ 4.650391] procd: - watchdog -
[ 5.267905] procd: - watchdog -
[ 5.277588] procd: - ubus -
[ 5.293610] random: ubusd: uninitialized urandom read (4 bytes read, 73 bits of entropy available)
[ 5.338304] random: ubusd: uninitialized urandom read (4 bytes read, 73 bits of entropy available)
[ 5.353919] random: ubusd: uninitialized urandom read (4 bytes read, 73 bits of entropy available)
[ 5.369286] random: ubusd: uninitialized urandom read (4 bytes read, 73 bits of entropy available)
[ 5.384545] random: ubusd: uninitialized urandom read (4 bytes read, 73 bits of entropy available)
[ 5.399449] random: ubusd: uninitialized urandom read (4 bytes read, 73 bits of entropy available)
[ 5.414311] random: ubusd: uninitialized urandom read (4 bytes read, 73 bits of entropy available)
[ 5.429054] random: ubusd: uninitialized urandom read (4 bytes read, 73 bits of entropy available)
[ 5.443826] procd: - init -
[ 5.548584] kmodloader: loading kernel modules from /etc/modules.d/*
[ 5.576092] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 5.593702] hidraw: raw HID events driver (C) Jiri Kosina
[ 5.618339] Loading modules backported from Linux version wt-2017-01-31-0-ge882dff19e7f
[ 5.632395] Backport generated by backports.git backports-20160324-13-g24da7d3c
[ 5.647153] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 5.662071] nf_conntrack version 0.5.0 (14884 buckets, 59536 max)
[ 5.791434] input: Logitech USB Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/0003:046D:C31D.0001/input/input0
[ 5.867209] hid-generic 0003:046D:C31D.0001: input,hidraw0: USB HID v1.10 Keyboard [Logitech USB Keyboard] on usb-3f980000.usb-1.5/input0
[ 5.910581] input: Logitech USB Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1/0003:046D:C31D.0002/input/input1
[ 5.987203] hid-generic 0003:046D:C31D.0002: input,hidraw1: USB HID v1.10 Device [Logitech USB Keyboard] on usb-3f980000.usb-1.5/input1
[ 6.006509] usbcore: registered new interface driver usbhid
[ 6.018956] usbhid: USB HID core driver
[ 6.034361] xt_time: kernel timezone is -0000
[ 6.059435] PPP generic driver version 2.4.2
[ 6.071282] NET: Registered protocol family 24
[ 6.183552] random: nonblocking pool is initialized
[ 6.198422] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Aug 29 2016 20:48:16 version 7.45.41.26 (r640327) FWID 01-4527cfab
[ 6.229485] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30)
[ 6.260293] usbcore: registered new interface driver brcmfmac
[ 6.276377] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 8.068541] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 8.084852] device eth0 entered promiscuous mode
[ 8.099023] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[ 9.736139] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x43E1
[ 9.753940] br-lan: port 1(eth0) entered forwarding state
[ 9.766468] br-lan: port 1(eth0) entered forwarding state
[ 9.778971] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[ 11.756864] br-lan: port 1(eth0) entered forwarding state
[ 127.261016] br-lan: port 1(eth0) entered disabled state
[ 127.275547] device eth0 left promiscuous mode
[ 127.281601] br-lan: port 1(eth0) entered disabled state
[ 127.289318] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 127.303754] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 127.448577] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 127.460248] device eth0 entered promiscuous mode
[ 127.469806] br-lan: port 1(eth0) entered forwarding state
[ 127.477302] br-lan: port 1(eth0) entered forwarding state
[ 128.979322] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x43E1
[ 129.476864] br-lan: port 1(eth0) entered forwarding state