CPU stalling in SMP - linux

We are facing an issue on which we need some help.
Brief write-up :
We have enabled SMP in Linux 2.6.39.4 kernel and cross compiled it for PPC-476. After booting, kernel is able to map both the processors (2 cores at h/w). The problem we are facing is, while running modprobe command repeatedly, one of the cpu goes into stall state. We have tried to dump stack of all active cpus (using sysrq) while one of the cpu is in stall state. The stack dump showed both the processors were executing same process (with same PID) i.e. modprobe.
Question :
1. is it possible for both the processors to be executing same process at a movement with same PID.
2. Is the execution of both process simultaneously give rise to some race condition which is causing either of CPU to go in stall state.
LOGS===============================================
SysRq : Show backtrace of all active CPUs
CPU0:
NIP: 701786c4 LR: 701752f0 CTR: 00000004
REGS: 9fb4fdc0 TRAP: 0501 Not tainted (2.6.39.4)
MSR: 00029000 <EE,ME,CE> CR: 44002048 XER: 00000000
TASK = 8f868ae0[827] 'modprobe' THREAD: 9fb48000 CPU: 0
GPR00: 08101820 9fb4fe70 8f868ae0 22222222 0002374d 00000002 00849ffc 00000000
GPR08: a2bb3a8c 00000810 a2c2aac4 00000148 44002088
NIP [701786c4] __sw_hweight32+0x50/0x58
LR [701752f0] __bitmap_weight+0x54/0xc0
Call Trace:
[9fb4fe70] [20000000] 0x20000000 (unreliable)
[9fb4fe90] [7006b1cc] sys_init_module+0x11a8/0x1ca4
[9fb4ff40] [7000f1b8] ret_from_syscall+0x0/0x3c
--- Exception: c01 at 0x10050e38
LR = 0x100a6708
Instruction dump:
7c634838 7c004838 7c001a14 5409e13e 7c090214 3d200f0f 61290f0f 7c004838
5409c23e 7c090214 5409843e 7c090214 <5403063e> 4e800020 5460f87e 70005555
CPU1:
NIP: 700a9678 LR: 700a964c CTR: 7012b0f8
REGS: 9fb4fe30 TRAP: 0501 Not tainted (2.6.39.4)
MSR: 00029000 <EE,ME,CE> CR: 80008022 XER: 20000000
TASK = 8f868ae0[827] 'modprobe' THREAD: 9fb48000 CPU: 1
GPR00: 00000000 9fb4fee0 8f868ae0 9efb9f20 9efb9f20 9fb4fee8 1004d6d0 0002d000
GPR08: 9efb9d68 9f8eee00 9efb9f20 00000000 20002022
NIP [700a9678] do_munmap+0x114/0x314
LR [700a964c] do_munmap+0xe8/0x314
Call Trace:
[9fb4fee0] [00000014] 0x14 (unreliable)
[9fb4ff20] [700aa7c8] sys_munmap+0x44/0x74
[9fb4ff40] [7000f1b8] ret_from_syscall+0x0/0x3c
--- Exception: c01 at 0x100510a8
LR = 0x10022088
Instruction dump:
4bffe461 7c641b79 41820010 80040004 7f9d0040 419d01d4 83210008 2e190000
41920200 83d9000c 801f0074 2f800000 <419e00f8> 2f9e0000 419e00f0 801e0004
Call Trace:
[9ffaff00] [70008654] show_stack+0x6c/0x1a4 (unreliable)
[9ffaff40] [70192d30] showacpu+0x84/0xcc
[9ffaff60] [700679bc] generic_smp_call_function_single_interrupt+0x100/0x18c
[9ffaff90] [7000ff6c] call_function_single_action+0x10/0x24
[9ffaffa0] [7006f7f4] handle_irq_event_percpu+0xa0/0x21c
[9ffaffe0] [700728d8] handle_percpu_irq+0x88/0xb8
[9ffafff0] [7000e038] call_handle_irq+0x18/0x28
[9fb4fdf0] [700044b0] do_IRQ+0xe8/0x1a0
[9fb4fe20] [7000f81c] ret_from_except+0x0/0x18
--- Exception: 501 at do_munmap+0x114/0x314
LR = do_munmap+0xe8/0x314
[9fb4fee0] [00000014] 0x14 (unreliable)
[9fb4ff20] [700aa7c8] sys_munmap+0x44/0x74
[9fb4ff40] [7000f1b8] ret_from_syscall+0x0/0x3c
--- Exception: c01 at 0x100510a8
=============================================================

Both questions of yours are False. There is no possibility that two cores run the same task at the same moment.
From the OOPS/panic trace, we can know that kernel panic on CPU 0 first, then it triggered the SysRq to "Show backtrace of all active CPUs". That is to say, CPU 1 works good at the time CPU 0 panic, but CPU 0 exception triggered to dump the backtrace of CPU 1.
Now let us analysis why CPU 0 panic: from the backtrace, it happened during "modprobe", so please analysis the kernel modules on your system to locate the one that trigger the panic.

Related

SMP threads not showing in GDB

Trying to debug multi CPU SoC (Amlogic A113X) and faced a problem.
So I have this debug configuration: A113X(JTAG) -> Segger J-Link V11 -> OpenOCD -> gdb-multiarch
Everything is connected and seems okay, but GDB shows just 1 thread (should be 4 - one for each CPU):
(gdb) info threads
Id Target Id Frame
* 1 Remote target 0xffffff8009853364 in arch_spin_lock (lock=<optimized out>) at ./arch/arm64/include/asm/spinlock.h:89
Meanwhile there are 4 debug targets according to telenet 'targets' command:
> targets
TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0* A113X.a53.0 aarch64 little A113X.cpu halted
1 A113X.a53.1 aarch64 little A113X.cpu halted
2 A113X.a53.2 aarch64 little A113X.cpu unknown
3 A113X.a53.3 aarch64 little A113X.cpu halted
Core 2 is shut down in this particular case.
When I halt CPUs then get this output in GDB:
(gdb) continue
Continuing.
^CA113X.a53.1 halted in AArch64 state due to debug-request, current mode: EL1H
cpsr: 0x800001c5 pc: 0xffffff8009853364
MMU: enabled, D-Cache: enabled, I-Cache: enabled
A113X.a53.3 halted in AArch64 state due to debug-request, current mode: EL1H
cpsr: 0x800000c5 pc: 0xffffff80098532b4
MMU: enabled, D-Cache: enabled, I-Cache: enabled
Program received signal SIGINT, Interrupt.
0xffffff8009853364 in arch_spin_lock (lock=<optimized out>) at ./arch/arm64/include/asm/spinlock.h:89
89 asm volatile(
(gdb) where
#0 0xffffff8009853364 in arch_spin_lock (lock=<optimized out>) at ./arch/arm64/include/asm/spinlock.h:89
#1 do_raw_spin_lock (lock=<optimized out>) at ./include/linux/spinlock.h:148
#2 __raw_spin_lock (lock=<optimized out>) at ./include/linux/spinlock_api_smp.h:145
#3 _raw_spin_lock (lock=0xffffffc01fb86a00) at kernel/locking/spinlock.c:151
#4 0xffffff80090c2114 in try_to_wake_up (p=0xffffffc01963a880, state=<optimized out>, wake_flags=0) at kernel/sched/core.c:2110
#5 0xffffff80090c239c in wake_up_process (p=<optimized out>) at kernel/sched/core.c:2203
#6 0xffffff80090b1b7c in wake_up_worker (pool=<optimized out>) at kernel/workqueue.c:837
#7 insert_work (pwq=<optimized out>, work=<optimized out>, head=<optimized out>, extra_flags=<optimized out>) at kernel/workqueue.c:1310
#8 0xffffff80090b1d10 in __queue_work (cpu=0, wq=0xdf2, work=0x8df2) at kernel/workqueue.c:1460
#9 0xffffff80090b1fc8 in queue_work_on (cpu=8, wq=0xffffffc01dbb5c00, work=0xffffffc01ccb82a0) at kernel/workqueue.c:1485
#10 0xffffff800191d068 in ?? ()
#11 0xffffffc0138664e8 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Is something wrong with my OpenOCD configuration? SMP config looks fine because it halts all 4 cores. What can be wrong here? Thanks beforehand.
Here is openocd config:
telnet_port 4444
gdb_port 3333
source [find interface/jlink.cfg]
transport select jtag
adapter speed 1000
scan_chain
set _CHIPNAME A113X
set _DAPNAME $_CHIPNAME.dap
jtag newtap $_CHIPNAME cpu -irlen 4 -expected-id 0x5ba00477
dap create $_DAPNAME -chain-position $_CHIPNAME.cpu
echo "$_CHIPNAME.cpu"
set CA53_DBGBASE {0x80410000 0x80510000 0x80610000 0x80710000}
set CA53_CTIBASE {0x80420000 0x80520000 0x80620000 0x80720000}
set _num_ca53 4
set _ap_num 0
set smp_targets ""
proc setup_a5x {core_name dbgbase ctibase num boot} {
for { set _core 0 } { $_core < $num } { incr _core } {
set _TARGETNAME $::_CHIPNAME.$core_name.$_core
set _CTINAME $_TARGETNAME.cti
cti create $_CTINAME -dap $::_DAPNAME -ap-num $::_ap_num \
-baseaddr [lindex $ctibase $_core]
target create $_TARGETNAME aarch64 -dap $::_DAPNAME -cti $_CTINAME -coreid $_core
set ::smp_targets "$::smp_targets $_TARGETNAME"
}
}
setup_a5x a53 $CA53_DBGBASE $CA53_CTIBASE $_num_ca53 1
echo "SMP targets:$smp_targets"
eval "target smp $smp_targets"
targets $_CHIPNAME.a53.0
And output of OpenOCD:
Open On-Chip Debugger 0.11.0+dev-00640-ge83eeb44a (2022-04-21-10:10)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
A113X.cpu
SMP targets: A113X.a53.0 A113X.a53.1 A113X.a53.2 A113X.a53.3
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : J-Link V11 compiled Mar 3 2022 10:16:14
Info : Hardware version: 11.00
Info : VTarget = 3.309 V
Info : clock speed 1000 kHz
Info : JTAG tap: A113X.cpu tap/device found: 0x5ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x5)
Info : A113X.a53.0: hardware has 6 breakpoints, 4 watchpoints
Info : A113X.a53.1: hardware has 6 breakpoints, 4 watchpoints
Error: JTAG-DP STICKY ERROR
Warn : target A113X.a53.2 examination failed
Info : A113X.a53.3: hardware has 6 breakpoints, 4 watchpoints
Info : A113X.a53.0 cluster 0 core 0 multi core
Info : A113X.a53.1 cluster 0 core 1 multi core
Info : A113X.a53.3 cluster 0 core 3 multi core
Info : starting gdb server for A113X.a53.0 on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : New GDB Connection: 1, Target A113X.a53.0, state: halted
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
A113X.a53.1 halted in AArch64 state due to debug-request, current mode: EL1H
cpsr: 0x800001c5 pc: 0xffffff8009853364
MMU: enabled, D-Cache: enabled, I-Cache: enabled
A113X.a53.3 halted in AArch64 state due to debug-request, current mode: EL1H
cpsr: 0x800000c5 pc: 0xffffff80098532b4
MMU: enabled, D-Cache: enabled, I-Cache: enabled
I tried to combine hwthread and targete smp to achieve multi-cores.
Add "-rtos hwthread" for each core, like
target create ...... -rtos hwthread
In my opinion, a core is regarded as a hwthread by OpenOCD, so set hwthread for each core. Following is the response of info threads.
(gdb) i threads
Id Target Id Frame
* 1 Thread 1 (Name: riscv.cpu0.0, state: debug-request) 0x8000000a in _mstart ()
2 Thread 2 (Name: riscv.cpu0.1, state: debug-request) 0x82000000 in ?? ()
3 Thread 3 (Name: riscv.cpu0.2, state: debug-request) 0x82000000 in ?? ()
4 Thread 4 (Name: riscv.cpu0.3, state: debug-request) 0x82000000 in ?? ()

RegexpParser crashes Python 3.8.6 kernel in JupyterLab

I am parsing chunks of pos-tagged text in JupyterLabs.
NLTK can run on Python<3.5 and >3.8 according to its faq.
I can return pos-tagged text just fine. But when I want to return parsed chunks, it crashes python.
I am running MacOS 11.1, Python 3.8.6, Jupyterlab 3.0.0, and nltk 3.5
from nltk import *
text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital
computer or the gears of a cycle transmission as he does at the top of a mountain
or in the petals of a flower. To think otherwise is to demean the Buddha...which is
to demean oneself."""
sentence_re = r'''(?x)
([A-Z])(\.[A-Z])+\.?
| \w+(-\w+)*
| \$?\d+(\.\d+)?%?
| \.\.\.
| [][.,;"'?():-_`]
'''
grammar = r"""
NBAR:
{<NN.*|JJ>*<NN.*>} # Nouns and Adjectives, terminated with Nouns
NP:
{<NBAR>}
{<NBAR><IN><NBAR>} # Above, connected with in/of/etc...
"""
chunker = RegexpParser(grammar)
toks = word_tokenize(text)
postoks = pos_tag(toks)
All is fine until I want to parse the chunks with RegexpParser. At which point, it crashes the kernel.
chunker.parse(postoks)
beginning of the crash report:
Process: Python [1549]
Path: /usr/local/Cellar/python#3.8/3.8.6_2/Frameworks/Python.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python
Identifier: org.python.python
Version: 3.8.6 (3.8.6)
Code Type: X86-64 (Native)
Parent Process: Python [1522]
Responsible: Terminal [416]
User ID: 501
Date/Time: 2020-12-29 15:34:13.546 -0500
OS Version: macOS 11.1 (20C69)
Report Version: 12
Anonymous UUID: 8EEE2257-0986-3569-AA83-52641AF02282
Time Awake Since Boot: 1200 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
abort() called
end of the crash report:
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 4
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 4785
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=835.0M resident=0K(0%) swapped_out_or_unallocated=835.0M(100%)
Writable regions: Total=1.5G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.5G(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Activity Tracing 256K 1
Dispatch continuations 64.0M 1
Kernel Alloc Once 8K 1
MALLOC 150.1M 37
MALLOC guard page 24K 5
MALLOC_MEDIUM (reserved) 960.0M 8 reserved VM address space (unallocated)
STACK GUARD 72K 18
Stack 86.6M 18
VM_ALLOCATE 182.5M 359
VM_ALLOCATE (reserved) 128.0M 2 reserved VM address space (unallocated)
__DATA 16.1M 460
__DATA_CONST 11.8M 200
__DATA_DIRTY 509K 87
__FONT_DATA 4K 1
__LINKEDIT 506.1M 241
__OBJC_RO 60.5M 1
__OBJC_RW 2452K 2
__TEXT 329.5M 432
__UNICODE 588K 1
mapped file 51.5M 9
shared memory 40K 4
=========== ======= =======
TOTAL 2.5G 1888
TOTAL, minus reserved VM space 1.4G 1888
Model: iMac18,2, BootROM 429.60.3.0.0, 4 processors, Quad-Core Intel Core i7, 3.6 GHz, 32 GB, SMC 2.40f1
Graphics: kHW_AMDRadeonPro560Item, Radeon Pro 560, spdisplays_pcie_device, 4 GB
Memory Module: BANK 0/DIMM0, 16 GB, DDR4 SO-DIMM, 2400 MHz, 0x802C, 0x313641544632473634485A2D3247334232202020
Memory Module: BANK 1/DIMM0, 16 GB, DDR4 SO-DIMM, 2400 MHz, 0x802C, 0x313641544632473634485A2D3247334232202020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x16E), Broadcom BCM43xx 1.0 (7.77.111.1 AirPortDriverBrcmNIC-1675.1)
Bluetooth: Version 8.0.2f9, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
USB Device: USB 3.0 Bus
USB Device: AS2105
USB Device: USB 2.0 BILLBOARD
USB Device: Bluetooth USB Host Controller
USB Device: FaceTime HD Camera (Built-in)
USB Device: Scarlett 2i4 USB
USB Device: My Passport 0827
Thunderbolt Bus: iMac, Apple Inc., 41.4

Managing interrupts from custom hardware

I am working on a driver for a custom piece of hardware (Xilinx FPGA based) and am having difficulty picking up the interrupt it is sending. The old system ran uCOS-II and just registered the interrupt ID 94. When I register that interrupt in Linux, it never triggers even though I know the hardware is sending the signal.
Is there something besides calling register_irqthat I need to do?
Is there a way for me to see all interrupt signals sent to the CPU even if nothing has registered for them?
/proc/interrupts:
CPU0 CPU1
16: 0 0 GIC-0 43 Level ttc_clockevent
17: 9383808 10190941 GIC-0 29 Edge twd
20: 68 0 GIC-0 82 Level xuartps
21: 0 0 GIC-0 45 Level f8003000.ps7-dma
22: 0 0 GIC-0 46 Level f8003000.ps7-dma
23: 0 0 GIC-0 47 Level f8003000.ps7-dma
24: 0 0 GIC-0 48 Level f8003000.ps7-dma
25: 0 0 GIC-0 49 Level f8003000.ps7-dma
26: 0 0 GIC-0 72 Level f8003000.ps7-dma
27: 0 0 GIC-0 73 Level f8003000.ps7-dma
28: 0 0 GIC-0 74 Level f8003000.ps7-dma
29: 0 0 GIC-0 75 Level f8003000.ps7-dma
33: 33759 0 GIC-0 54 Level eth0
35: 16184 0 GIC-0 56 Level mmc0
36: 0 0 GIC-0 57 Level cdns-i2c
37: 15117 0 GIC-0 58 Level e0006000.spi
38: 9 0 GIC-0 81 Level e0007000.spi
39: 204 0 GIC-0 40 Level f8007000.devcfg
40: 43 0 GIC-0 39 Level f8007100.xadc
41: 0 0 GIC-0 89 Edge 7c400000.dma
42: 0 0 GIC-0 88 Edge 7c420000.dma
94: 0 0 zynq-gpio 48 Level my_int_handle
IPI1: 0 0 Timer broadcast interrupts
IPI2: 25906 23777 Rescheduling interrupts
IPI3: 37 17 Function call interrupts
IPI4: 0 0 CPU stop interrupts
IPI5: 0 0 IRQ work interrupts
IPI6: 0 0 completion interrupts
Err: 0
Boot Log:
EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
* Will now restart
þeboot: Restarting system
U-Boot 2015.07-03600-g7bcb6ed (Dec 22 2015 - 12:24:30 +0200)
Model: Zynq PicoZed SDR2 Board
I2C: ready
DRAM: ECC disabled 1 GiB
MMC: zynq_sdhci: 0
Invalid bus 0 (err=-1)
*** Warning - spi_flash_probe() failed, using default environment
In: serial
Out: serial
Err: serial
Model: Zynq PicoZed SDR2 Board
Net: Gem.e000b000
Hit any key to stop autoboot: 0
Device: zynq_sdhci
Manufacturer ID: 3
OEM: 5344
Name: SS08G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading uEnv.txt
679 bytes read in 10 ms (65.4 KiB/s)
Loaded environment from uEnv.txt
Importing environment from SD ...
Running uenvcmd ...
Setting clocks
Copying Linux from SD to RAM...
reading uImage
3946384 bytes read in 380 ms (9.9 MiB/s)
reading devicetree.dtb
8768 bytes read in 46 ms (185.5 KiB/s)
reading uramdisk.image.gz
** Unable to read file uramdisk.image.gz **
## Booting kernel from Legacy Image at 03000000 ...
Image Name: Linux-4.9.0
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3946320 Bytes = 3.8 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02a00000
Booting using the fdt blob at 0x2a00000
Loading Kernel Image ... OK
Loading Device Tree to 1fffa000, end 1ffff23f ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 4.9.0 (root#analog) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) ) #2 SMP PREEMPT Tue Feb 27 22:37:50 UTC 2018
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: ags,FMC
bootconsole [earlycon0] enabled
cma: Reserved 128 MiB at 0x38000000
Memory policy: Data cache writealloc
percpu: Embedded 13 pages/cpu #ef7d5000 s23744 r8192 d21312 u53248
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260608
Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 900532K/1048576K available (5249K kernel code, 231K rwdata, 1696K rodata, 260K init, 154K bss, 16972K reserved, 131072K cma-reserved, 131072K highmem)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc0528a24 (5251 kB)
.init : 0xc0701000 - 0xc0742000 ( 260 kB)
.data : 0xc0742000 - 0xc077bd80 ( 232 kB)
.bss : 0xc077bd80 - 0xc07a27b4 ( 155 kB)
Preemptible hierarchical RCU implementation.
Build-time adjustment of leaf fanout to 32.
RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
efuse mapped to f0802000
slcr mapped to f0804000
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
zynq_clock_init: clkc starts at f0804100
Zynq clock init
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
sched_clock: 16 bits at 54kHz, resolution 18432ns, wraps every 603975816ns
timer #0 at f080c000, irq=16
Console: colour dummy device 80x30
Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x82c0 - 0x8318
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (2664.03 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource ttc_clocksource
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
workingset: timestamp_bits=30 max_order=18 bucket_order=0
jitterentropy: Initialization failed with host not compliant with requirements: 2
bounce: pool size: 64 pages
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.ps7-dma: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.ps7-dma: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
e0001000.uart: ttyPS0 at MMIO 0xe0001000 (irq = 20, base_baud = 6249999) is a xuartps
àconsole [ttyPS0] enabled
console [ttyPS0] enabled
bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to f0871000
[drm] Initialized
brd: module loaded
loop: module loaded
spidev spi32766.0: buggy DT: spidev listed directly in DT
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1 at drivers/spi/spidev.c:757 spidev_probe+0x178/0x1b4
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.0 #2
Hardware name: Xilinx Zynq Platform
[<c0015f30>] (unwind_backtrace) from [<c0012914>] (show_stack+0x10/0x14)
[<c0012914>] (show_stack) from [<c01e60b8>] (dump_stack+0x84/0xa4)
[<c01e60b8>] (dump_stack) from [<c0023e48>] (__warn+0xd4/0x100)
[<c0023e48>] (__warn) from [<c0023e94>] (warn_slowpath_null+0x20/0x28)
[<c0023e94>] (warn_slowpath_null) from [<c02f2d44>] (spidev_probe+0x178/0x1b4)
[<c02f2d44>] (spidev_probe) from [<c02f0dfc>] (spi_drv_probe+0x7c/0xa8)
[<c02f0dfc>] (spi_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0298184>] (bus_for_each_drv+0x44/0x8c)
[<c0298184>] (bus_for_each_drv) from [<c029991c>] (__device_attach+0x9c/0x100)
[<c029991c>] (__device_attach) from [<c029900c>] (bus_probe_device+0x84/0x8c)
[<c029900c>] (bus_probe_device) from [<c0297578>] (device_add+0x380/0x528)
[<c0297578>] (device_add) from [<c02f0c54>] (spi_add_device+0x8c/0x130)
[<c02f0c54>] (spi_add_device) from [<c02f25bc>] (spi_register_master+0x438/0x778)
[<c02f25bc>] (spi_register_master) from [<c02f5250>] (cdns_spi_probe+0x2bc/0x384)
[<c02f5250>] (cdns_spi_probe) from [<c029b15c>] (platform_drv_probe+0x50/0xb0)
[<c029b15c>] (platform_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0299cf8>] (__driver_attach+0xac/0xb0)
[<c0299cf8>] (__driver_attach) from [<c0298220>] (bus_for_each_dev+0x54/0x88)
[<c0298220>] (bus_for_each_dev) from [<c02991f0>] (bus_add_driver+0xe8/0x1f4)
[<c02991f0>] (bus_add_driver) from [<c029a4f4>] (driver_register+0x78/0xf4)
[<c029a4f4>] (driver_register) from [<c00097ac>] (do_one_initcall+0x3c/0x16c)
[<c00097ac>] (do_one_initcall) from [<c0701d80>] (kernel_init_freeable+0x11c/0x1e8)
[<c0701d80>] (kernel_init_freeable) from [<c05233a8>] (kernel_init+0x8/0xfc)
[<c05233a8>] (kernel_init) from [<c000f938>] (ret_from_fork+0x14/0x3c)
---[ end trace dd90ee247f61645e ]---
spidev spi32765.0: buggy DT: spidev listed directly in DT
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1 at drivers/spi/spidev.c:757 spidev_probe+0x178/0x1b4
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 4.9.0 #2
Hardware name: Xilinx Zynq Platform
[<c0015f30>] (unwind_backtrace) from [<c0012914>] (show_stack+0x10/0x14)
[<c0012914>] (show_stack) from [<c01e60b8>] (dump_stack+0x84/0xa4)
[<c01e60b8>] (dump_stack) from [<c0023e48>] (__warn+0xd4/0x100)
[<c0023e48>] (__warn) from [<c0023e94>] (warn_slowpath_null+0x20/0x28)
[<c0023e94>] (warn_slowpath_null) from [<c02f2d44>] (spidev_probe+0x178/0x1b4)
[<c02f2d44>] (spidev_probe) from [<c02f0dfc>] (spi_drv_probe+0x7c/0xa8)
[<c02f0dfc>] (spi_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0298184>] (bus_for_each_drv+0x44/0x8c)
[<c0298184>] (bus_for_each_drv) from [<c029991c>] (__device_attach+0x9c/0x100)
[<c029991c>] (__device_attach) from [<c029900c>] (bus_probe_device+0x84/0x8c)
[<c029900c>] (bus_probe_device) from [<c0297578>] (device_add+0x380/0x528)
[<c0297578>] (device_add) from [<c02f0c54>] (spi_add_device+0x8c/0x130)
[<c02f0c54>] (spi_add_device) from [<c02f25bc>] (spi_register_master+0x438/0x778)
[<c02f25bc>] (spi_register_master) from [<c02f5250>] (cdns_spi_probe+0x2bc/0x384)
[<c02f5250>] (cdns_spi_probe) from [<c029b15c>] (platform_drv_probe+0x50/0xb0)
[<c029b15c>] (platform_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0299cf8>] (__driver_attach+0xac/0xb0)
[<c0299cf8>] (__driver_attach) from [<c0298220>] (bus_for_each_dev+0x54/0x88)
[<c0298220>] (bus_for_each_dev) from [<c02991f0>] (bus_add_driver+0xe8/0x1f4)
[<c02991f0>] (bus_add_driver) from [<c029a4f4>] (driver_register+0x78/0xf4)
[<c029a4f4>] (driver_register) from [<c00097ac>] (do_one_initcall+0x3c/0x16c)
[<c00097ac>] (do_one_initcall) from [<c0701d80>] (kernel_init_freeable+0x11c/0x1e8)
[<c0701d80>] (kernel_init_freeable) from [<c05233a8>] (kernel_init+0x8/0xfc)
[<c05233a8>] (kernel_init) from [<c000f938>] (ret_from_fork+0x14/0x3c)
---[ end trace dd90ee247f61645f ]---
spidev spi32765.1: buggy DT: spidev listed directly in DT
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1 at drivers/spi/spidev.c:757 spidev_probe+0x178/0x1b4
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 4.9.0 #2
Hardware name: Xilinx Zynq Platform
[<c0015f30>] (unwind_backtrace) from [<c0012914>] (show_stack+0x10/0x14)
[<c0012914>] (show_stack) from [<c01e60b8>] (dump_stack+0x84/0xa4)
[<c01e60b8>] (dump_stack) from [<c0023e48>] (__warn+0xd4/0x100)
[<c0023e48>] (__warn) from [<c0023e94>] (warn_slowpath_null+0x20/0x28)
[<c0023e94>] (warn_slowpath_null) from [<c02f2d44>] (spidev_probe+0x178/0x1b4)
[<c02f2d44>] (spidev_probe) from [<c02f0dfc>] (spi_drv_probe+0x7c/0xa8)
[<c02f0dfc>] (spi_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0298184>] (bus_for_each_drv+0x44/0x8c)
[<c0298184>] (bus_for_each_drv) from [<c029991c>] (__device_attach+0x9c/0x100)
[<c029991c>] (__device_attach) from [<c029900c>] (bus_probe_device+0x84/0x8c)
[<c029900c>] (bus_probe_device) from [<c0297578>] (device_add+0x380/0x528)
[<c0297578>] (device_add) from [<c02f0c54>] (spi_add_device+0x8c/0x130)
[<c02f0c54>] (spi_add_device) from [<c02f25bc>] (spi_register_master+0x438/0x778)
[<c02f25bc>] (spi_register_master) from [<c02f5250>] (cdns_spi_probe+0x2bc/0x384)
[<c02f5250>] (cdns_spi_probe) from [<c029b15c>] (platform_drv_probe+0x50/0xb0)
[<c029b15c>] (platform_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0299cf8>] (__driver_attach+0xac/0xb0)
[<c0299cf8>] (__driver_attach) from [<c0298220>] (bus_for_each_dev+0x54/0x88)
[<c0298220>] (bus_for_each_dev) from [<c02991f0>] (bus_add_driver+0xe8/0x1f4)
[<c02991f0>] (bus_add_driver) from [<c029a4f4>] (driver_register+0x78/0xf4)
[<c029a4f4>] (driver_register) from [<c00097ac>] (do_one_initcall+0x3c/0x16c)
[<c00097ac>] (do_one_initcall) from [<c0701d80>] (kernel_init_freeable+0x11c/0x1e8)
[<c0701d80>] (kernel_init_freeable) from [<c05233a8>] (kernel_init+0x8/0xfc)
[<c05233a8>] (kernel_init) from [<c000f938>] (ret_from_fork+0x14/0x3c)
---[ end trace dd90ee247f616460 ]---
spidev spi32765.2: buggy DT: spidev listed directly in DT
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1 at drivers/spi/spidev.c:757 spidev_probe+0x178/0x1b4
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 4.9.0 #2
Hardware name: Xilinx Zynq Platform
[<c0015f30>] (unwind_backtrace) from [<c0012914>] (show_stack+0x10/0x14)
[<c0012914>] (show_stack) from [<c01e60b8>] (dump_stack+0x84/0xa4)
[<c01e60b8>] (dump_stack) from [<c0023e48>] (__warn+0xd4/0x100)
[<c0023e48>] (__warn) from [<c0023e94>] (warn_slowpath_null+0x20/0x28)
[<c0023e94>] (warn_slowpath_null) from [<c02f2d44>] (spidev_probe+0x178/0x1b4)
[<c02f2d44>] (spidev_probe) from [<c02f0dfc>] (spi_drv_probe+0x7c/0xa8)
[<c02f0dfc>] (spi_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0298184>] (bus_for_each_drv+0x44/0x8c)
[<c0298184>] (bus_for_each_drv) from [<c029991c>] (__device_attach+0x9c/0x100)
[<c029991c>] (__device_attach) from [<c029900c>] (bus_probe_device+0x84/0x8c)
[<c029900c>] (bus_probe_device) from [<c0297578>] (device_add+0x380/0x528)
[<c0297578>] (device_add) from [<c02f0c54>] (spi_add_device+0x8c/0x130)
[<c02f0c54>] (spi_add_device) from [<c02f25bc>] (spi_register_master+0x438/0x778)
[<c02f25bc>] (spi_register_master) from [<c02f5250>] (cdns_spi_probe+0x2bc/0x384)
[<c02f5250>] (cdns_spi_probe) from [<c029b15c>] (platform_drv_probe+0x50/0xb0)
[<c029b15c>] (platform_drv_probe) from [<c0299b94>] (driver_probe_device+0x1f0/0x2a8)
[<c0299b94>] (driver_probe_device) from [<c0299cf8>] (__driver_attach+0xac/0xb0)
[<c0299cf8>] (__driver_attach) from [<c0298220>] (bus_for_each_dev+0x54/0x88)
[<c0298220>] (bus_for_each_dev) from [<c02991f0>] (bus_add_driver+0xe8/0x1f4)
[<c02991f0>] (bus_add_driver) from [<c029a4f4>] (driver_register+0x78/0xf4)
[<c029a4f4>] (driver_register) from [<c00097ac>] (do_one_initcall+0x3c/0x16c)
[<c00097ac>] (do_one_initcall) from [<c0701d80>] (kernel_init_freeable+0x11c/0x1e8)
[<c0701d80>] (kernel_init_freeable) from [<c05233a8>] (kernel_init+0x8/0xfc)
[<c05233a8>] (kernel_init) from [<c000f938>] (ret_from_fork+0x14/0x3c)
---[ end trace dd90ee247f616461 ]---
MACsec IEEE 802.1AE
libphy: Fixed MDIO Bus: probed
libphy: mdio_driver_register: xgmiitorgmii
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk#qualcomm.com>
libphy: XEMACPS mii bus: probed
[Firmware Warn]: /amba#0/eth#e000b000/phy#0: Whitelisted compatible string. Please remove
xemacps e000b000.eth: pdev->id -1, baseaddr 0xe000b000, irq 33
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 36
usbcore: registered new interface driver uvcvideo
USB Video Class driver (1.1.1)
gspca_main: v2.14.0 registered
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
hidraw: raw HID events driver (C) Jiri Kosina
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
cf_axi_adc 79020000.cf-ad9361-lpc: could not find spi node
OF: /fpga-axi#0/cf-ad9361-dds-core-lpc#79024000: could not find phandle
ERROR: could not get clock /fpga-axi#0/cf-ad9361-dds-core-lpc#79024000:sampl_clk(0)
cf_axi_dds: probe of 79024000.cf-ad9361-dds-core-lpc failed with error -2
NET: Registered protocol family 17
zynq_pm_remap_ocm: no compatible node found for 'xlnx,zynq-ocmc-1.0'
zynq_pm_suspend_init: Unable to map OCM.
Registering SWP/SWPB emulation handler
hctosys: unable to open rtc device (rtc0)
ALSA device list:
No soundcards found.
Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SDHC card at address aaaa
mmcblk0: mmc0:aaaa SS08G 7.40 GiB
mmcblk0: p1 p2 p3
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 260K (c0701000 - c0742000)
This architecture does not have kernel memory protection.
random: fast init done
Mount failed for selinuxfs on /sys/fs/selinux: No such file or directory
init: hwclock main process (799) terminated with status 1
Adding 511996k swap on /swapfile. Priority:-1 extents:1 across:511996k SS
* Setting up X socket directories... [ OK ]
Setting default sampling frequency to 2.1 MSPS
/etc/rcS.d/S99default-sdr: line 3: /sys/bus/iio/devices/iio:device1/in_voltage_sampling_frequency: No such file or directory
Loading default filter
/etc/rcS.d/S99default-sdr: line 7: /sys/bus/iio/devices/iio:device1/filter_fir_config: No such file or directory
* STARTDISTCC is set to false in /etc/default/distcc
* /usr/bin/distccd not starting
* Starting NTP server ntpd [ OK ]
* Starting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
*
* Starting IIO Daemon iiod [ OK ]
Last login: Thu Jan 1 21:40:23 UTC 1970 from 169.254.212.36 on pts/1
Welcome to Linaro 14.04 (GNU/Linux 4.9.0 armv7l)
Which driver are you using, your custom driver or Xilinx GPIO?
As I understand you hardcoded Linux IRQ number 94 in register irq?
94: 0 0 zynq-gpio 48 Level my_int_handle
I would say that you have to declare your GPIO node as interrupt controller in the device tree with appropiate interrupt property, because driver uses that information for interrupt:
gpio->irq = platform_get_irq(pdev, 0);
I'm not sure of the exact IRQ number mapping.
Device tree node for GPIO controller on Zynq looks like this:
gpio#e000a000 {
#gpio-cells = <2>;
#interrupt-cells = <2>;
compatible = "xlnx,zynq-gpio-1.0";
clocks = <&&clkc 42>;
gpio-controller;
interrupt-controller;
interrupt-parent = <&&intc>;
interrupts = <0 20 4>;
interrupt-controller;
#interrupt-cells = <2>;
reg = <0xe000a000 0x1000>;
};
If you use hardcoded Linux IRQ number instead of device tree, you can try to find it with probe_irq_on/off();

Read errors after an UBIFS update

I am encountering the messages below after creating an UBIFS filesystem in
a new UBI volume on an existing UBI partition.
This happens while reading all the files on the UBI fs via tar -cf /dev/null *:
UBIFS error (pid 1810): ubifs_read_node: bad node type (255 but expected 1)
UBIFS error (pid 1810): ubifs_read_node: bad node at LEB 33:967120, LEB mapping status 0
Not a node, first 24 bytes:
00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
CPU: 0 PID: 1810 Comm: tar Tainted: P O 3.18.80 #3
Backtrace:
[<8001b664>] (dump_backtrace) from [<8001b880>] (show_stack+0x18/0x1c)
r7:00000000 r6:00000000 r5:80000013 r4:80566cbc
[<8001b868>] (show_stack) from [<801d77e0>] (dump_stack+0x88/0xa4)
[<801d7758>] (dump_stack) from [<80171608>] (ubifs_read_node+0x1fc/0x2b8)
r7:00000021 r6:00000712 r5:000ec1d0 r4:bd59d000
[<8017140c>] (ubifs_read_node) from [<8018b654>](ubifs_tnc_read_node+0x88/0x124)
r10:00000000 r9:b4f9fdb0 r8:bd59d264 r7:00000001 r6:b71e6000 r5:bd59d000
r4:b6126148
[<8018b5cc>] (ubifs_tnc_read_node) from [<80174690>](ubifs_tnc_locate+0x108/0x1e0)
r7:00000001 r6:b71e6000 r5:00000001 r4:bd59d000
[<80174588>] (ubifs_tnc_locate) from [<80168200>] (do_readpage+0x1c0/0x39c)
r10:bd59d000 r9:000005b1 r8:00000000 r7:bd258710 r6:a5914000 r5:b71e6000
r4:be09e280
[<80168040>] (do_readpage) from [<80169398>] (ubifs_readpage+0x44/0x424)
r10:00000000 r9:00000000 r8:bd59d000 r7:be09e280 r6:00000000 r5:bd258710
r4:00000000
[<80169354>] (ubifs_readpage) from [<80089654>](generic_file_read_iter+0x48c/0x5d8)
r10:00000000 r9:00000000 r8:00000000 r7:be09e280 r6:bd2587d4 r5:bd5379e0
r4:00000000
[<800891c8>] (generic_file_read_iter) from [<800bbd60>](new_sync_read+0x84/0xa8)
r10:00000000 r9:b4f9e000 r8:80008e24 r7:bd6437a0 r6:bd5379e0 r5:b4f9ff80
r4:00001000
[<800bbcdc>] (new_sync_read) from [<800bc85c>] (__vfs_read+0x20/0x54)
r7:b4f9ff80 r6:7ec2d800 r5:00001000 r4:800bbcdc
[<800bc83c>] (__vfs_read) from [<800bc91c>] (vfs_read+0x8c/0xf4)
r5:00001000 r4:bd5379e0
[<800bc890>] (vfs_read) from [<800bc9cc>] (SyS_read+0x48/0x80)
r9:b4f9e000 r8:80008e24 r7:00001000 r6:7ec2d800 r5:bd5379e0 r4:bd5379e0
[<800bc984>] (SyS_read) from [<80008c80>] (ret_fast_syscall+0x0/0x3c)
r7:00000003 r6:7ec2d800 r5:00000008 r4:00082a08
UBIFS error (pid 1811): do_readpage: cannot read page 0 of inode 1457, error -22
Mounting looks like this:
UBI-0: ubi_attach_mtd_dev:default fastmap pool size: 190
UBI-0: ubi_attach_mtd_dev:default fastmap WL pool size: 25
UBI-0: ubi_attach_mtd_dev:attaching mtd3 to ubi0
UBI-0: scan_all:scanning is finished
UBI-0: ubi_attach_mtd_dev:attached mtd3 (name "data", size 3824 MiB)
UBI-0: ubi_attach_mtd_dev:PEB size: 1048576 bytes (1024 KiB), LEB size: 1040384 bytes
UBI-0: ubi_attach_mtd_dev:min./max. I/O unit sizes: 4096/4096, sub-page size 4096
UBI-0: ubi_attach_mtd_dev:VID header offset: 4096 (aligned 4096), data offset: 8192
UBI-0: ubi_attach_mtd_dev:good PEBs: 3816, bad PEBs: 8, corrupted PEBs: 0
UBI-0: ubi_attach_mtd_dev:user volume: 6, internal volumes: 1, max. volumes count: 128
UBI-0: ubi_attach_mtd_dev:max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 1362948729
UBI-0: ubi_attach_mtd_dev:available PEBs: 2313, total reserved PEBs: 1503, PEBs reserved for bad PEB handling: 72
UBI-0: ubi_thread:background thread "ubi_bgt0d" started, PID 419
UBIFS: mounted UBI device 0, volume 6, name "slot1", R/O mode
UBIFS: LEB size: 1040384 bytes (1016 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes
UBIFS: FS size: 259055616 bytes (247 MiB, 249 LEBs), journal size 12484608 bytes (11 MiB, 12 LEBs)
UBIFS: reserved for root: 4952683 bytes (4836 KiB)
UBIFS: media format: w4/r0 (latest is w4/r0), UUID 92C7B251-2666-4717-B735-5539900FE749, small LPT model
The rate of reproduction is one in about 20 sequences of: ubirmvol,
ubimkvol (256MB), unpack a rootfs.tgz (20MB, 40MB unpacked) in the
mounted UBIFS, umount, ubidetach, sync, reboot. There are no xattrs
created. No power cuts happen during the tests.
The board runs a 3.18.80 kernel on an ARM board. I tested other
identical test boards where only the NAND chip manufacturer was
different.
I had CONFIG_MTD_UBI_FASTMAP enabled when the error occured, but I
used no explicit fastmap boot cmdline option. I tried mounting the
ubifs with a rebuilt kernel that had the config option disabled after
the issue reproduced, but the read error still occured.
I also tried mounting with a kernel that had "ubifs: Fix journal
replay w.r.t. xattr nodes" patch [1] applied, after reading older similar error reports, but once reproduced on a NAND, the read error
persisted.
[1] https://patchwork.ozlabs.org/patch/713213/
Is there some special requirement except just umount, ubidetach and
sync before running reboot, or regarding free space fixup ? Would
creating the fs image offline with mkfs.ubifs instead of unpacking it
via tar make a difference here ? Would it help to test with
cherry picked commits from linux v4.14 that touch
fs/ubifs ?

sbull ldd3 example driver gets stuck

I'm writing a block device driver and started with the sbull example from here:
http://lwn.net/images/pdf/LDD3/ldd3_pdf.tar.bz2
I loaded the sbull driver successfully on my machine with kernel version 3.5.0-23.
When I run this code:
int main(){
int fd;
if ((fd = open("/dev/sbulla",O_RDWR)) < 0)
{
perror("open: ");
exit(1);
}
lseek(fd,4096,SEEK_SET);
write(fd,"yonityoyin",10);
lseek(fd,4096*2,SEEK_SET);
write(fd,"yonityoyin",10);
close(fd);
}
The session gets stuck.
If i open another session on the machine and print dmesg i get this after some time:
[56437.815570] INFO: task a.out:4640 blocked for more than 120 seconds.
[56437.822742] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[56437.831563] a.out D ffffffff8180cbe0 0 4640 4639 0x00000000
[56437.831571] ffff880852715c08 0000000000000082 0000000000000000 0000000000000001
[56437.831580] ffff880852715fd8 ffff880852715fd8 ffff880852715fd8 00000000000139c0
[56437.831588] ffff8808547c0000 ffff880851bc2e00 ffff880852715be8 ffff88085fd74258
[56437.831595] Call Trace:
[56437.831623] [<ffffffff81127220>] ? __lock_page+0x70/0x70
[56437.831638] [<ffffffff8169d8b9>] schedule+0x29/0x70
[56437.831643] [<ffffffff8169d98f>] io_schedule+0x8f/0xd0
[56437.831652] [<ffffffff8112722e>] sleep_on_page+0xe/0x20
[56437.831657] [<ffffffff8169c25f>] __wait_on_bit+0x5f/0x90
[56437.831663] [<ffffffff81127c1b>] ? find_get_pages_tag+0xcb/0x170
[56437.831674] [<ffffffff81127388>] wait_on_page_bit+0x78/0x80
[56437.831682] [<ffffffff81078490>] ? autoremove_wake_function+0x40/0x40
[56437.831691] [<ffffffff8112749c>] filemap_fdatawait_range+0x10c/0x1a0
[56437.831701] [<ffffffff81133000>] ? do_writepages+0x20/0x40
[56437.831706] [<ffffffff8112755b>] filemap_fdatawait+0x2b/0x30
[56437.831711] [<ffffffff811298e4>] filemap_write_and_wait+0x44/0x60
[56437.831718] [<ffffffff811c0091>] __sync_blockdev+0x21/0x40
[56437.831722] [<ffffffff811c00c3>] sync_blockdev+0x13/0x20
[56437.831726] [<ffffffff811c0139>] __blkdev_put+0x69/0x1c0
[56437.831736] [<ffffffff811c02eb>] blkdev_put+0x5b/0x160
[56437.831740] [<ffffffff811c0415>] blkdev_close+0x25/0x30
[56437.831750] [<ffffffff81188afe>] __fput+0xbe/0x240
[56437.831756] [<ffffffff81188ca5>] fput+0x25/0x30
[56437.831761] [<ffffffff81185976>] filp_close+0x66/0x90
[56437.831766] [<ffffffff81185a3e>] sys_close+0x9e/0x110
[56437.831775] [<ffffffff816a7029>] system_call_fastpath+0x16/0x1b
What could be the problem with the driver?
Just to be clear, I get this problem with the original sbull driver.
Please refer the newer example code.
https://github.com/martinezjavier/ldd3

Resources