I am trying to port system clocks for custom SoC into linux kernel (4.9). I had setup a minimal lookup table with crystal Osc, pll & spi as below:
static struct clk_lookup clocks[] = {
CLKDEV_INIT(NULL, "ref", &ref_clk),
CLKDEV_INIT(NULL, "pll1", &pll1_clk),
CLKDEV_INIT(NULL, "apb_pclk", &apb_clk),
CLKDEV_INIT("spi0", NULL, &spi_clk),
};
and im trying to add clocks using func:
int __init clocks_init(void)
{
clkdev_add_table(clocks, ARRAY_SIZE(clocks));
};
But my booting fails while trying to setup clocks.
below is the error:
Unable to handle kernel NULL pointer dereference at virtual address 00000008
[ 0.000000]` pgd = c0004000
[ 0.000000] [00000008] *pgd=00000000
[ 0.000000] Internal error: Oops: 5 [#1] ARM
[ 0.000000] Modules linked in:
[ 0.000000] CPU: 0 PID: 1 Comm: swapper Not tainted 4.9.22+ #22
[ 0.000000] Hardware name: CUSTOMSOC
[ 0.000000] task: c6898000 task.stack: c688e000
[ 0.000000] PC is at __clk_get_hw+0x1c/0x24
[ 0.000000] LR is at clkdev_add_table+0x40/0x78
[ 0.000000] pc : [<c025ce40>] lr : [<c025cda8>] psr: a0000053
[ 0.000000] sp : c688fe58 ip : c688fe68 fp : c688fe64
[ 0.000000] r10: 00000000 r9 : 0000003d r8 : c04867f0
[ 0.000000] r7 : c04ea720 r6 : c04ea714 r5 : 00000004 r4 : c04cbf50
[ 0.000000] r3 : 00000000 r2 : 00000000 r1 : 00000004 r0 : c04cbf98
[ 0.000000] Flags: NzCv IRQs on FIQs off Mode SVC_32 ISA ARM Segment user
[ 0.000000] Control: 00c5387d Table: c0004008 DAC: 00000055
[ 0.000000] Process swapper (pid: 1, stack limit = 0xc688e188)
[ 0.000000] Stack: (0xc688fe58 to 0xc6890000)
[ 0.000000] fe40: c688fe84 c688fe68
[ 0.000000] fe60: c025cda8 c025ce30 00000000 c8905000 c0501020 c04ae820 c688fea4 c688fe88
[ 0.000000] fe80: c048a6d8 c025cd74 00000000 c03004d4 c04ca798 c04cd718 c688febc c688fea8
[ 0.000000] fea0: c048a4a8 c048a62c c04c27f8 00000003 c688fecc c688fec0 c0486814 c048a49c
[ 0.000000] fec0: c688ff4c c688fed0 c0009a6c c04867fc c0483614 c02268b8 00000000 c0434e84
[ 0.000000] fee0: c6fffe00 c032ca2c c688ff4c c688fef8 c003e5f4 c0483604 c0050050 c00bb438
[ 0.000000] ff00: 00000000 c030f938 00000003 00000003 00000000 c04349c0 c03d2654 00000000
[ 0.000000] ff20: c688ff4c c04c27f8 00000003 c0501020 c04ae820 00000000 0000003d c04ae838
[ 0.000000] ff40: c688ff94 c688ff50 c0483ec0 c0009a2c 00000003 00000003 00000000 c04835f8
[ 0.000000] ff60: 9d322010 62802229 20a41903 00000000 c030cc94 00000000 00000000 00000000
[ 0.000000] ff80: 00000000 00000000 c688ffac c688ff98 c030ccac c0483d48 ffffffff 00000000
[ 0.000000] ffa0: 00000000 c688ffb0 c00107c8 c030cca0 00000000 00000000 00000000 00000000
[ 0.000000] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 0.000000] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 0114212a 8dce8aa8
[ 0.000000] [<c025ce40>] (__clk_get_hw) from [<c025cda8>] (clkdev_add_table+0x40/0x78)
[ 0.000000] [<c025cda8>] (clkdev_add_table) from [<c048a6d8>] (bbsoc_clocks_init+0xb8/0xec)
[ 0.000000] [<c048a6d8>] (clocks_init) from [<c048a4a8>] (bcm2835_init+0x18/0x74)
[ 0.000000] [<c048a4a8>] (board_init) from [<c0486814>] (customize_machine+0x24/0x30)
[ 0.000000] [<c0486814>] (customize_machine) from [<c0009a6c>] (do_one_initcall+0x4c/0x180)
[ 0.000000] [<c0009a6c>] (do_one_initcall) from [<c0483ec0>] (kernel_init_freeable+0x184/0x254)
[ 0.000000] [<c0483ec0>] (kernel_init_freeable) from [<c030ccac>] (kernel_init+0x18/0x114)
[ 0.000000] [<c030ccac>] (kernel_init) from [<c00107c8>] (ret_from_fork+0x14/0x2c)
[ 0.000000] Code: e52de004 e8bd4000 e3500000 15903000 (15930008)
[ 0.000000] ---[ end trace 671b49261be9dc6a ]---
[ 0.000000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
upon investigation func: __clk_get_hw(cl->clk);
is trying to access clk->core->hw (This is where exactly it is failing!)
struct clk_hw *__clk_get_hw(struct clk *clk)
{
return !clk ? NULL : clk->core->hw;
}
EXPORT_SYMBOL_GPL(__clk_get_hw);
Any suggestions on setting up clock configuration into linux kernel, would be highly helpful.
Thanks,
Vivek
Issue got resolved upon programming complete clock driver specific to SoC.
1. Firstly bus clock to be registered, it depends on input PLL clocks and the dividers or multipliers it has encountered. The info regarding dividers and multipliers can be found in sys-control registers. Once all the buses (ex: ahb, apb) got registered.
hw = clk_hw_register_fixed_rate(NULL, "ref", NULL, 0, 40MHZ); //setting
if (IS_ERR(hw))
pr_err("xtal clock not registered\n");
hw = clk_hw_register_fixed_rate(NULL, "pll_clk", "ref", 0, 800MHZ);
if (IS_ERR(hw))
pr_err("pll_clk not registered\n");
hw = clk_hw_register_fixed_rate(NULL, "ahb_clk", "pll_clk", 0, 100MHZ);
if (IS_ERR(hw))
pr_err("ahb_clk not registered\n");
peripheral oriented clock can be specified as, here i am trying to register dma clock. which is mounted on AHB bus.
static struct clk dma1_clk = {
.name = "xyz.dma",
.parent = &ahb_clk,
.rate = FREQ_200MHZ,
};
later the clock structure with respect peripheral can be registered as
hw = clk_hw_register_fixed_rate(NULL, c->dev_id, "ahb_clk", 0, temp_clk->rate);
if (IS_ERR(hw))
pr_err("Device Hw:%s not registered\n", c->dev_id);
ret = clk_hw_register_clkdev(hw, NULL, c->dev_id);
if (ret)
pr_err("Device:%s not registered\n", c->dev_id);
The clock infra setup for peripheral in SoC can be done through Device tree as well.
Thanks to #0andriy for responding over the post.
Thanks.
Related
I am writing code for a linux kernel module that allocates space and stores some data in it, but the kmalloc allocation happens in the write function for the vfs api as i need the size of the buffer coming from the user application and i cannot access it outside the write function. where should i place the kfree() function? i cannot place it in under cleanup because it gives me an error whenever i try to uninstall the module.
ssize_t hcsr04_write(struct file *filp, const char *buffer, size_t length, loff_t * offset)
{
if (pulsecount < (5)){
pulseptr[pulsecount] = kmalloc(sizeof(buffer),GFP_ATOMIC);
sprintf (pulseptr[pulsecount],"%s",buffer);
pulsecount++;
}
else{
int j = 0;
while (j<4){
sprintf (pulseptr[j], "%s", (pulseptr[j+1]) ); // [5 , 20 , 30 , 70 , 50] ===> [20 , 30 , 70 , 50 , 50]
j++;
}
sprintf (pulseptr[4],"%s",buffer);
}
}
this is my write function.
static void __exit hcsr04_module_cleanup(void)
{
//if (pulseptr!= {NULL,NULL,NULL,NULL,NULL}){
kfree(pulseptr);
printk(KERN_INFO "Dynamic memory freed successfully.");
//}
//pulseptr = {NULL,NULL,NULL,NULL,NULL};
gpio_free( GPIO_OUT );
gpio_free( GPIO_IN );
hcsr04_lock = 0;
cdev_del(&hcsr04_cdev);
unregister_chrdev_region( hcsr04_dev, 1 );
kobject_put( hcsr04_kobject );
}
this is the cleanup function. if i execute rmmod command with the cleanup function like this i get the following error :
[ 93.294821] 8<--- cut here ---
[ 93.297928] Unable to handle kernel paging request at virtual address bcf03574
[ 93.305253] pgd = 3cdbb3d3
[ 93.307993] [bcf03574] *pgd=00000000
[ 93.311621] Internal error: Oops: 5 [#1] SMP ARM
[ 93.316301] Modules linked in: hcsr04(O-) nfc bnep bluetooth ecdh_generic ecc ipv6 hello(PO) g_serial libcomposite udc_core brcmfmac brcmutil sha256_generic libsha256 vc4 cfg80211 bcm2835_codec(C) rfkill bcm2835_isp(C) bcm2835_v4l2(C) v4l2_mem2mem cec bcm2835_mmal_vchiq(C) videobuf2_dma_contig snd_soc_core videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 snd_compress snd_pcm_dmaengine videobuf2_common snd_pcm videodev snd_timer mc snd raspberrypi_hwmon vc_sm_cma(C) uio_pdrv_genirq uio fixed
[ 93.360563] CPU: 0 PID: 478 Comm: rmmod Tainted: P C O 5.4.72-v7 #1
[ 93.368060] Hardware name: BCM2835
[ 93.371516] PC is at kfree+0x48/0x2bc
[ 93.375235] LR is at hcsr04_module_cleanup+0x18/0xcac [hcsr04]
[ 93.381148] pc : [<802fd004>] lr : [<7f17a36c>] psr: 20010013
[ 93.387501] sp : b80abf08 ip : b80abf38 fp : b80abf34
[ 93.392797] r10: 00000081 r9 : b80aa000 r8 : 801011c4
[ 93.398095] r7 : 7f17a36c r6 : 7e92dc38 r5 : 7f17c000 r4 : bcf03570
[ 93.404713] r3 : bab24000 r2 : 00000024 r1 : 00000000 r0 : 7f17c000
[ 93.411333] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 93.418568] Control: 10c5383d Table: 38d5806a DAC: 00000055
[ 93.424394] Process rmmod (pid: 478, stack limit = 0x274b04e4)
[ 93.430307] Stack: (0xb80abf08 to 0xb80ac000)
[ 93.434728] bf00: 801c8158 80989110 7f17c0c0 00000000 7e92dc38 00000081
[ 93.443026] bf20: 801011c4 b80aa000 b80abf4c b80abf38 7f17a36c 802fcfc8 7f17c0c0 00000000
[ 93.451324] bf40: b80abfa4 b80abf50 801ca940 7f17a360 72736368 00003430 00000000 80da6b10
[ 93.459621] bf60: 80101068 7e92cbe8 00000000 801011c4 b80aa000 00000006 b80abfac b80abf88
[ 93.467918] bf80: 80228294 8022938c 00000000 80e05f88 00000000 7e92de2c 00000000 b80abfa8
[ 93.476216] bfa0: 80101000 801ca7e0 00000000 7e92de2c 01677694 00000800 6a0f1b00 7e92dbe4
[ 93.484513] bfc0: 00000000 7e92de2c 7e92dc38 00000081 7e92df1f 7e92dc34 01677190 00000001
[ 93.492811] bfe0: 004e1f70 7e92dbec 004c866f 76f37218 60010030 01677694 00000000 00000000
[ 93.501100] Backtrace:
[ 93.503593] [<802fcfbc>] (kfree) from [<7f17a36c>] (hcsr04_module_cleanup+0x18/0xcac [hcsr04])
[ 93.512331] r9:b80aa000 r8:801011c4 r7:00000081 r6:7e92dc38 r5:00000000 r4:7f17c0c0
[ 93.520195] [<7f17a354>] (hcsr04_module_cleanup [hcsr04]) from [<801ca940>] (sys_delete_module+0x16c/0x244)
[ 93.530073] r5:00000000 r4:7f17c0c0
[ 93.533704] [<801ca7d4>] (sys_delete_module) from [<80101000>] (ret_fast_syscall+0x0/0x28)
[ 93.542084] Exception stack(0xb80abfa8 to 0xb80abff0)
[ 93.547209] bfa0: 00000000 7e92de2c 01677694 00000800 6a0f1b00 7e92dbe4
[ 93.555507] bfc0: 00000000 7e92de2c 7e92dc38 00000081 7e92df1f 7e92dc34 01677190 00000001
[ 93.563801] bfe0: 004e1f70 7e92dbec 004c866f 76f37218
[ 93.568922] r5:7e92de2c r4:00000000
[ 93.572549] Code: e3a02024 e5933000 e1a04624 e0243492 (e5943004)
[ 93.578730] ---[ end trace cff8773499967501 ]---
the error goes away once i comment out kfree
I Realised what i did wrong. I shouldve done kfree(pulseptr[0]) where 0 can be the index number of the memory locations i have allocated.
When kernel run finished, a code "echo 1 > /proc/sys/net/ipv4/ip_forward" execute in the last of /etc/rc.sh. About restart 10 to 20 times , the kernel will crash once when run this code.
I don't know how to resolve this problem, because the most times board start success.
Following is the log from board to kernel crash. Can somebody give me some advice? Thanks!
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Linux version 4.1.0 (guyanjun#localhost.localdomain) (gcc version 4.8.3 20140401 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2014.04 - Linaro GCC 4.8-2014.04) ) #1 SMP PREEMPT Tue Apr 19 10:00:22 CST 2022
[ 0.000000] CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: Altera SOCFPGA Arria 10
[ 0.000000] ***** enter arm_memblock_init phys_initrd_start = 0x3000000, phys_initrd_size = 0x1e00000*****
[ 0.000000] phys_initrd_start: 0x3000000, phys_initrd_size: 0x1e00000
[ 0.000000] phys_initrd_start: 0x3000000, phys_initrd_size: 0x1e00000
[ 0.000000] phys_initrd_start: 0x3000000, phys_initrd_size: 0x1e00000
[ 0.000000] initrd_start: 0xc3000000, initrd_end: 0xc4e00000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] PERCPU: Embedded 12 pages/cpu #e590a000 s19904 r8192 d21056 u49152
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 153924
[ 0.000000] Kernel command line: console=ttyS0,115200 initrd=0x3000000,30M root=/dev/ram0 rw init=/linuxrc rootfstype=ext2 mem=606M ip=172.27.246.2:::::eth1:off isolcpus=1
[ 0.000000] IP-Config: Parameter #0: `172.27.246.2'
[ 0.000000] IP-Config: Parameter #5: `eth1'
[ 0.000000] IP-Config: Parameter #6: `off'
[ 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: 576444K/620544K available (5056K kernel code, 481K rwdata, 1512K rodata, 300K init, 123K bss, 44100K reserved, 0K 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 : 0xe6000000 - 0xff000000 ( 400 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xe5e00000 ( 606 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0672360 (6569 kB)
[ 0.000000] .init : 0xc0673000 - 0xc06be000 ( 300 kB)
[ 0.000000] .data : 0xc06be000 - 0xc0736604 ( 482 kB)
[ 0.000000] .bss : 0xc0736604 - 0xc0755298 ( 124 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Additional per-CPU info printed with stalls.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] SOCFPGA: Unable to find sdr-ctl
[ 0.000000] L2C: platform modifies aux control register: 0x72160001 -> 0x72560001
[ 0.000000] L2C: platform provided aux values permit register corruption.
[ 0.000000] L2C: DT/platform modifies aux control register: 0x72160001 -> 0x72560001
[ 0.000000] L2C-310 erratum 769419 enabled
[ 0.000000] L2C-310 enabling early BRESP for Cortex-A9
[ 0.000000] L2C-310: enabling full line of zeros but not enabled in Cortex-A9
[ 0.000000] L2C-310 ID prefetch enabled, offset 1 lines
[ 0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[ 0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[ 0.000000] L2C-310: CACHE_ID 0x410030c9, AUX_CTRL 0x76560001
[ 0.000000] ^^^^^res.start = 0xffffc600 ^^^^^
[ 0.000000] ^^^^^ event_timer->name =timer irq=17 ^^^^^
[ 0.000000] ^^^^^res.start = 0xffc02700 ^^^^^
[ 0.000000] ^^^^^ base = 0xe6008700 , irq = 17 ^^^^^
[ 0.000000] ^^^^^res.start = 0xffc02800 ^^^^^
[ 0.000000] clocksource timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns
[ 0.000004] sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 21474836475ns
[ 0.000294] Console: colour dummy device 80x30
[ 0.000313] Calibrating delay loop... 2387.14 BogoMIPS (lpj=11935744)
[ 0.059769] pid_max: default: 32768 minimum: 301
[ 0.059873] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.059883] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.060462] CPU: Testing write buffer coherency: ok
[ 0.060684] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.060755] Setting up static identity map for 0x8280 - 0x82d8
[ 0.179782] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.179851] Brought up 2 CPUs
[ 0.179866] SMP: Total of 2 processors activated (4780.85 BogoMIPS).
[ 0.179874] CPU: All CPU(s) started in SVC mode.
[ 0.180300] devtmpfs: initialized
[ 0.186998] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[ 0.187371] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.188557] NET: Registered protocol family 16
[ 0.188609] fpga bridge driver
[ 0.189307] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.194827] ^^^^^hwirq = 0 ^^^^^
[ 0.198103] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[ 0.198114] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.233043] FPGA Mangager framework driver
[ 0.233452] vgaarb: loaded
[ 0.233744] SCSI subsystem initialized
[ 1.229773] i2c_designware ffc02300.i2c: controller timed out
[ 1.229796] lcd_load_custom_fonts: i2c_master_send returns -110
[ 2.229765] i2c_designware ffc02300.i2c: controller timed out
[ 2.229777] lcd_cmd_no_params: i2c_master_send returns -110
[ 3.229764] i2c_designware ffc02300.i2c: controller timed out
[ 3.229776] lcd_cmd_one_param: i2c_master_send returns -110
[ 4.229764] i2c_designware ffc02300.i2c: controller timed out
[ 4.229775] lcd_cmd_no_params: i2c_master_send returns -110
[ 4.229800] lcd-comm 0-0028: LCD driver initialized
[ 4.230145] pps_core: LinuxPPS API ver. 1 registered
[ 4.230154] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
[ 4.230183] PTP clock support registered
[ 4.231352] Switched to clocksource timer
[ 4.307511] NET: Registered protocol family 2
[ 4.308498] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 4.308557] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 4.308648] TCP: Hash tables configured (established 8192 bind 8192)
[ 4.308734] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 4.308785] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 4.308999] NET: Registered protocol family 1
[ 4.309891] RPC: Registered named UNIX socket transport module.
[ 4.309903] RPC: Registered udp transport module.
[ 4.309910] RPC: Registered tcp transport module.
[ 4.309917] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 4.310161] Trying to unpack rootfs image as initramfs...
[ 4.310637] rootfs image is not initramfs (no cpio magic); looks like an initrd
[ 4.439724] Freeing initrd memory: 30720K (c3000000 - c4e00000)
[ 4.440479] CPU PMU: Failed to parse /sopc#0/pmu0/interrupt-affinity[0]
[ 4.440532] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[ 4.440627] arm-pmu arm-pmu: PMU:CTI successfully enabled for 2 cores
[ 4.442146] futex hash table entries: 512 (order: 3, 32768 bytes)
[ 4.459771] NFS: Registering the id_resolver key type
[ 4.459815] Key type id_resolver registered
[ 4.459823] Key type id_legacy registered
[ 4.459847] Installing knfsd (copyright (C) 1996 okir#monad.swb.de).
[ 4.460760] ntfs: driver 2.1.32 [Flags: R/W].
[ 4.461307] jffs2: version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
[ 4.463814] io scheduler noop registered (default)
[ 4.465279] PCI host bridge /sopc#0/pcie#0xc0000000 ranges:
[ 4.465308] MEM 0xc0000000..0xcfffffff -> 0x00000000
[ 4.465482] altera-pcie c0000000.pcie: PCI host bridge to bus 0000:00
[ 4.465496] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 4.465510] pci_bus 0000:00: root bus resource [mem 0xc0000000-0xcfffffff] (bus address [0x00000000-0x0fffffff])
[ 4.465793] ^^^^^^^^^^^^^^^^^^^^^^^Enter altera_pcie_retrain
[ 4.466574] ^^^^^^^^^^^^^^^^^^altera_pcie_retrain:altera_pcie is link up spend 645us!
[ 4.468065] PCI: bus0: Fast back to back transfers disabled
[ 4.468096] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[ 4.470649] PCI: bus1: Fast back to back transfers disabled
[ 4.470987] pci 0000:00:00.0: BAR 8: assigned [mem 0xc0000000-0xc0ffffff]
[ 4.470999] pci 0000:00:00.0: BAR 1: assigned [mem 0xc1000000-0xc100000f]
[ 4.472112] pci 0000:01:00.0: BAR 0: assigned [mem 0xc0000000-0xc0ffffff]
[ 4.472158] pci 0000:00:00.0: PCI bridge to [bus 01]
[ 4.472208] pci 0000:00:00.0: bridge window [mem 0xc0000000-0xc0ffffff]
[ 4.472451] PCI host bridge /sopc#0/pcie#0xd0000000 ranges:
[ 4.472474] MEM 0xd0000000..0xdfffffff -> 0x00000000
[ 4.472724] altera-pcie d0000000.pcie: PCI host bridge to bus 0001:00
[ 4.472739] pci_bus 0001:00: root bus resource [bus 00-ff]
[ 4.472751] pci_bus 0001:00: root bus resource [mem 0xd0000000-0xdfffffff] (bus address [0x00000000-0x0fffffff])
[ 4.473026] ^^^^^^^^^^^^^^^^^^^^^^^Enter altera_pcie_retrain
[ 4.473805] ^^^^^^^^^^^^^^^^^^altera_pcie_retrain:altera_pcie is link up spend 645us!
[ 4.475855] PCI: bus0: Fast back to back transfers disabled
[ 4.475887] pci 0001:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[ 4.478709] PCI: bus1: Fast back to back transfers disabled
[ 4.479163] pci 0001:00:00.0: BAR 8: assigned [mem 0xd0000000-0xd0ffffff]
[ 4.479176] pci 0001:00:00.0: BAR 1: assigned [mem 0xd1000000-0xd100000f]
[ 4.479222] pci 0001:01:00.0: BAR 0: assigned [mem 0xd0000000-0xd0ffffff]
[ 4.479264] pci 0001:00:00.0: PCI bridge to [bus 01]
[ 4.479313] pci 0001:00:00.0: bridge window [mem 0xd0000000-0xd0ffffff]
[ 4.484077] dma-pl330 ffda1000.dma: Loaded driver for PL330 DMAC-341330
[ 4.484093] dma-pl330 ffda1000.dma: DBUFF-512x8bytes Num_Chans-8 Num_Peri-32 Num_Events-8
[ 4.492766] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 4.495144] console [ttyS0] disabled
[ 4.495250] ffc02100.serial: ttyS0 at MMIO 0xffc02100 (irq = 35, base_baud = 6250000) is a 16550A
[ 5.411683] console [ttyS0] enabled
[ 5.416223] socfpga_a10_fpga_manager ffd03000.fpgamgr: fpga manager [SoCFPGA Arria10 FPGA Manager] registered as minor 0
[ 5.430169] brd: module loaded
[ 5.433794] at24 0-0051: 4096 byte 24c32 EEPROM, writable, 32 bytes/write
[ 5.441682] ^^^^^ enter cqspi_probe ^^^^^
[ 5.445914] ^^^^^ cs = 0 ^^^^^
[ 5.449082] cadence-qspi ff809000.flash: Read data capture delay for 50000000 baud calibrated to 1 (0 - 2)
[ 5.459299] ^^^^^ id = 0xc04fed30 ^^^^^
[ 5.463257] ~~~~~~~~spi_nor_scan:mutex_init~~~~~~~~~~~~
[ 5.468463] ^^^^^ mode = 0x3, info->flags = 0x40 ^^^^^
[ 5.473725] cadence-qspi ff809000.flash: mx66l1g45g (131072 Kbytes)
[ 5.479967] mtd .name = ff809000.flash, .size = 0x8000000 (128MiB),.erasesize = 0x00010000 (64KiB) .numeraseregions = 0
[ 5.491074] 8 ofpart partitions found on MTD device ff809000.flash
[ 5.497229] Creating 8 MTD partitions on "ff809000.flash":
[ 5.502729] 0x000000000000-0x000000100000 : "Uboot"
[ 5.508612] 0x000000100000-0x000000500000 : "Kernel Image & Device Tree"
[ 5.516508] 0x000000500000-0x000000900000 : "Root Filesystem - RAMFS"
[ 5.524144] 0x000000900000-0x000000a00000 : "Rsv"
[ 5.529977] 0x000000a00000-0x000001200000 : "Kernel Image & Device Tree Backup"
[ 5.538452] 0x000001200000-0x000002900000 : "Fpga Area"
[ 5.544960] 0x000002900000-0x000004000000 : "Fpga Area-backup"
[ 5.551952] 0x000004000000-0x000008000000 : "flashdev"
[ 5.558172] cadence-qspi ff809000.flash: Cadence QSPI NOR flash driver
[ 5.568573] libphy: Fixed MDIO Bus: probed
[ 5.573758] e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
[ 5.579568] e1000e: Copyright(c) 1999 - 2014 Intel Corporation.
[ 5.586849] ^^^^^ enter stmmac_probe_config_dt func ^^^^^
[ 5.592750] =======.======compare phy_mode with rgmii.
[ 5.597920] =======.======compare phy_mode with rgmii.
[ 5.603083] ==============.=============dwmac->interface = 7
[ 5.608791] ^^^^^ enter stmmac_dvr_probe ndev->name = (null) ^^^^^
[ 5.615303] stmmac - user ID: 0x10, Synopsys ID: 0x37
[ 5.620333] Ring mode enabled
[ 5.623415] DMA HW capability register supported
[ 5.627925] Enhanced/Alternate descriptors
[ 5.632307] Enabled extended descriptors
[ 5.636300] RX Checksum Offload Engine supported (type 2)
[ 5.641809] TX Checksum insertion supported
[ 5.646061] ^^^^^ call stmmac_hw_init successful ^^^^^
[ 5.651274] Enable RX Mitigation via HW Watchdog Timer
[ 5.659452] libphy: stmmac: probed
[ 5.663065] eth0: No PHY found
[ 5.666235] ^^^^^ enter netif_napi_del ^^^^^
[ 5.670575] stmmac_pltfr_probe: main driver probe failed^^^^^ enter stmmac_probe_config_dt func ^^^^^
[ 5.680084] =======.======compare phy_mode with gmii.
[ 5.685206] =======.======compare phy_mode with gmii.
[ 5.690237] ==============.=============dwmac->interface = 2
[ 5.695984] ^^^^^ enter stmmac_dvr_probe ndev->name = (null) ^^^^^
[ 5.702306] stmmac - user ID: 0x10, Synopsys ID: 0x37
[ 5.707335] Ring mode enabled
[ 5.710375] DMA HW capability register supported
[ 5.714921] Enhanced/Alternate descriptors
[ 5.719268] Enabled extended descriptors
[ 5.723291] RX Checksum Offload Engine supported (type 2)
[ 5.728751] TX Checksum insertion supported
[ 5.733012] ^^^^^ call stmmac_hw_init successful ^^^^^
[ 5.738212] Enable RX Mitigation via HW Watchdog Timer
[ 5.744133] ^^^^^ enter stmmac_probe_config_dt func ^^^^^
[ 5.749615] =======.======compare phy_mode with mii.
[ 5.754778] =======.======compare phy_mode with mii.
[ 5.759722] ==============.=============dwmac->interface = 1
[ 5.765420] ^^^^^ enter stmmac_dvr_probe ndev->name = (null) ^^^^^
[ 5.771742] stmmac - user ID: 0x10, Synopsys ID: 0x37
[ 5.776771] Ring mode enabled
[ 5.779811] DMA HW capability register supported
[ 5.784392] Enhanced/Alternate descriptors
[ 5.788739] Enabled extended descriptors
[ 5.792763] RX Checksum Offload Engine supported (type 2)
[ 5.798224] TX Checksum insertion supported
[ 5.802505] ^^^^^ call stmmac_hw_init successful ^^^^^
[ 5.807706] Enable RX Mitigation via HW Watchdog Timer
[ 5.814251] mousedev: PS/2 mouse device common for all mice
[ 6.811022] i2c_designware ffc02300.i2c: controller timed out
[ 6.816771] rtc-ds1307: probe of 0-0068 failed with error -5
[ 6.822521] i2c /dev entries driver
[ 6.827010] ^^^^^ enter dw_wdt_drv_probe ^^^^^
[ 6.831935] ^^^^^ step 1 ^^^^^
[ 6.835079] /sopc#0/timer#0xffd00300: could not get #clock-cells for /sopc#0/clkmgr#0xffd04000
[ 6.843716] dw_wdt: probe of ffd00300.timer failed with error -2
[ 6.850350] oprofile: using arm/armv7-ca9
[ 6.854881] NET: Registered protocol family 17
[ 6.859343] NET: Registered protocol family 15
[ 6.864035] NET: Registered protocol family 33
[ 6.868465] Key type rxrpc registered
[ 6.872151] Key type rxrpc_s registered
[ 6.876011] 8021q: 802.1Q VLAN Support v1.8
[ 6.880234] Key type dns_resolver registered
[ 6.884749] ThumbEE CPU extension supported.
[ 6.889016] Registering SWP/SWPB emulation handler
[ 6.898901] IP-Config: Entered.
[ 6.992767] IP-Config: eth1 UP (able=0, xid=00000000)
[ 7.011041] IP-Config: Guessing netmask 255.255.0.0
[ 7.016047] IP-Config: Complete:
[ 7.019268] device=eth1, hwaddr=00:01:02:00:01:c0, ipaddr=172.27.246.2, mask=255.255.0.0, gw=255.255.255.255
[ 7.029538] host=172.27.246.2, domain=, nis-domain=(none)
[ 7.035381] bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
[ 7.043554] ttyS0 - failed to request DMA
[ 7.047690] RAMDISK: gzip image found at block 0
[ 7.870209] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 7.876262] devtmpfs: mounted
[ 7.879472] Freeing unused kernel memory: 300K (c0673000 - c06be000)
^^^^^^step one^^^^^^
^^^^^step two^^^^^
^^^^^ aaaa=1:eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 ^^^^^[ 7.909610] device eth1 entered promiscuous mode
^^^^^bbbb=00^^^^^
^^^^^cccc=01^^^^^
^^^^^ there is no eth0
^^^^^ set eth1 ^^^^^
[ 7.919259] device eth2 entered promiscuous mode
^^^^^ set eth2 ^^^^^
[ 8.049576] random: nonblocking pool is initialized
[ 8.762977] Unable to handle kernel paging request at virtual address e60f8000
[ 8.770175] pgd = e0580000
[ 8.772941] [e60f8000] *pgd=2542f811, *pte=00000000, *ppte=00000000
[ 8.779225] Internal error: Oops: 7 [#1] PREEMPT SMP ARM
[ 8.784514] Modules linked in:
[ 8.787571] CPU: 0 PID: 658 Comm: rc.sh Not tainted 4.1.0 #1
[ 8.793203] Hardware name: Altera SOCFPGA
[ 8.797196] task: e54f7900 ti: e00b0000 task.ti: e00b0000
[ 8.802580] PC is at dwmac1000_rx_ipc_enable+0x10/0x58
[ 8.807704] LR is at stmmac_set_features+0x3c/0x44
[ 8.812474] pc : [<c03ab914>] lr : [<c03a4be0>] psr: 60050013
[ 8.812474] sp : e00b1e28 ip : c03ab910 fp : 00000000
[ 8.823897] r10: c072a09c r9 : c0726b5c r8 : 00000000
[ 8.829098] r7 : e5642400 r6 : e5535000 r5 : 00000000 r4 : e60f8000
[ 8.835595] r3 : c03ab904 r2 : 00000000 r1 : 00000000 r0 : e3123480
[ 8.842095] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 8.849197] Control: 10c5387d Table: 2058004a DAC: 00000015
[ 8.854916] Process rc.sh (pid: 658, stack limit = 0xe00b0218)
[ 8.860723] Stack: (0xe00b1e28 to 0xe00b2000)
[ 8.865063] 1e20: c03ab904 00004921 00000000 c03a4be0 00000000 c03ff1dc
[ 8.873205] 1e40: e5535000 60050013 00004921 00000000 e5535000 00000001 c0726ac0 c03ff238
[ 8.881346] 1e60: e5535000 c03ff26c e5535000 60050013 e00b1e80 e5535034 e5535000 00000001
[ 8.889487] 1e80: c0726ac0 c045683c e00b1f80 00000001 001676f8 e56a5b40 c072a09c 00000001
[ 8.897628] 1ea0: 001676f8 e00b1f80 00000002 00000002 00000000 c014f144 e00b1f80 001676f8
[ 8.905769] 1ec0: 00000002 00000002 001676f8 001676f8 e0116540 e00b1f80 00000002 001676f8
[ 8.913910] 1ee0: 00000000 c014f178 00000001 001676f8 00000002 c00fa06c 00000000 c02d6750
[ 8.922051] 1f00: 00000000 e5432800 00000001 00000001 00000002 00000188 001676f8 c00fc160
[ 8.930192] 1f20: 00000020 c00fa750 00000001 e0116540 e00b1f80 00000002 e0116540 001676f8
[ 8.938333] 1f40: e0116540 001676f8 e00b1f80 00000002 00000002 c00fa794 e0116540 001676f8
[ 8.946474] 1f60: 00000002 00000000 00000000 e0116540 e0116540 00000002 001676f8 c00faeb0
[ 8.954615] 1f80: 00000002 00000000 00000002 0016466c 00000001 001676f8 00000004 c000ee84
[ 8.962755] 1fa0: e00b0000 c000ed00 0016466c 00000001 00000001 001676f8 00000002 00000000
[ 8.970896] 1fc0: 0016466c 00000001 001676f8 00000004 00000020 001668c8 00000000 00000000
[ 8.979037] 1fe0: 00000000 bebb8614 000289e9 0000b906 60050030 00000001 00000000 00000000
[ 8.987191] [<c03ab914>] (dwmac1000_rx_ipc_enable) from [<c03a4be0>] (stmmac_set_features+0x3c/0x44)
[ 8.996293] [<c03a4be0>] (stmmac_set_features) from [<c03ff1dc>] (__netdev_update_features+0x1c8/0x210)
[ 9.005648] [<c03ff1dc>] (__netdev_update_features) from [<c03ff238>] (netdev_update_features+0x14/0x28)
[ 9.015088] [<c03ff238>] (netdev_update_features) from [<c03ff26c>] (dev_disable_lro+0x20/0x168)
[ 9.023843] [<c03ff26c>] (dev_disable_lro) from [<c045683
inet_sysctl_forward+0x104/0x1a0)
[ 9.032687] [<c045683c>] (devinet_sysctl_forward) from [<c014f144>] (proc_sys_call_handler+0xa0/0xbc)
[ 9.041870] [<c014f144>] (proc_sys_call_handler) from [<c014f178>] (proc_sys_write+0x18/0x20)
[ 9.050366] [<c014f178>] (proc_sys_write) from [<c00fa06c>] (__vfs_write+0x34/0xdc)
[ 9.057994] [<c00fa06c>] (__vfs_write) from [<c00fa794>] (vfs_write+0xac/0x150)
[ 9.065274] [<c00fa794>] (vfs_write) from [<c00faeb0>] (SyS_write+0x44/0x84)
[ 9.072300] [<c00faeb0>] (SyS_write) from [<c000ed00>] (ret_fast_syscall+0x0/0x3c)
[ 9.079839] Code: e92d4038 e52de004 ebf1aa91 e590402c (e5945000)
[ 9.086349] stmmaceth ff802000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[ 9.094483] ---[ end trace 8a28184619420ae6 ]---
nb_sys_init: nb_common_init error! errno = -303
nb_sys_init error!
172.27.246.2 login: [ 10.091054] stmmaceth ff804000.ethernet eth2: Link is Up - 100Mbps/Full - flow control off
172.27.246.2 login:
I'm using Delayed Workqueue into a kernel module.
My module data structure is like this :
struct module_data {
...
struct workqueue_struct *check_hook_wq;
struct delayed_work check_hook;
...
};
My function for initialize the workqueue is like this :
void init_workqueue(struct module_data *wc)
{
wc->check_hook_wq = create_workqueue("Check_Hook");
INIT_DELAYED_WORK(&wc->check_hook, check_hook_handler);
}
Into "main" function, I do things like this (CHECK_HOOK_DELAY_MS = 5) :
void main(void)
{
...
init_workqueue(wc);
queue_delayed_work(wc->check_hook_wq, &wc->kipbx_check_hook, msecs_to_jiffies(CHECK_HOOK_DELAY_MS));
...
}
Everything works fine until there, but when the workqueue timer ends, the system crashes with the following error, and don't enter at all in my check_hook_handler function :
[ 330.206323] Unable to handle kernel paging request at virtual address 7f7f7f7e
[ 330.213568] pgd = c0004000
[ 330.216292] [7f7f7f7e] *pgd=00000000
root#solidrun-imx6:~# [ 330.219895] Internal error: Oops: 80000005 [#1] SMP ARM
[ 330.227035] Modules linked in: kipbx(O) dahdi(O)
[ 330.231736] CPU: 1 PID: 116 Comm: mmcqd/0 Tainted: G O 3.14.60+g4386797 #233
[ 330.239670] task: dc1c9b80 ti: ddece000 task.ti: ddece000
[ 330.245083] PC is at 0x7f7f7f7e
[ 330.248254] LR is at call_timer_fn+0x24/0x84
[ 330.252541] pc : [<7f7f7f7e>] lr : [<c00349f8>] psr: 200701b3
[ 330.252541] sp : ddecfe18 ip : 00000000 fp : 00200200
[ 330.264035] r10: 00000000 r9 : ddecfe48 r8 : 00000002
[ 330.269273] r7 : 7f7f7f7f r6 : 00000100 r5 : ddece000 r4 : ddece018
[ 330.275812] r3 : ddecfe18 r2 : 7f7f7f7f r1 : 7f7f7f7f r0 : 7f7f7f7f
[ 330.282355] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA Thumb Segment kernel
[ 330.289937] Control: 10c53c7d Table: 2854004a DAC: 00000015
[ 330.295697] Process mmcqd/0 (pid: 116, stack limit = 0xddece238)
[ 330.301717] Stack: (0xddecfe18 to 0xdded0000)
[ 330.306088] fe00: dc032000 7f7f7f7f
[ 330.314285] fe20: 7f7f7f7f d8c2e308 dc032000 7f7f7f7f 7f7f7f7f c0035190 d8c2e32c 00000001
[ 330.322483] fe40: c0a060c0 dc032814 ddecfe48 ddecfe48 ffffffff 00000020 c0a06084 ddece000
[ 330.330679] fe60: 00000100 ddece038 00000001 c0a06080 40000001 c002f23c cb0aee0c 0000004c
[ 330.338874] fe80: cb0aee0c 00000001 c0a06080 c0a00470 c0a60e00 0000000a c0754098 00007483
[ 330.347071] fea0: c0a060c0 00208840 00000000 ddece010 0000001d 00000000 f4a00100 00000001
[ 330.355266] fec0: dc37b410 00000000 00000000 c002f5b4 c0a00ee8 c000ec04 f4a0010c c0a0daa8
[ 330.363463] fee0: ddecff00 c00084e0 c07519c8 20070013 ffffffff ddecff34 00000001 c00121c0
[ 330.371658] ff00: dc37b410 60070013 dc37b410 000009c5 dc37b408 dc375240 ddece000 00000000
[ 330.379854] ff20: 00000001 dc37b410 00000000 00000000 00000000 ddecff48 c0436474 c07519c8
[ 330.388053] ff40: 20070013 ffffffff 00000000 dde95a00 dc37b408 c0436348 00000000 00000000
[ 330.396249] ff60: 00000000 c0046bc8 c0a872a4 00000000 00002e31 dc37b408 00000000 00000000
[ 330.404446] ff80: ddecff80 ddecff80 00000000 00000000 ddecff90 ddecff90 ddecffac dde95a00
[ 330.412641] ffa0: c0046af8 00000000 00000000 c000e3c0 00000000 00000000 00000000 00000000
[ 330.420836] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 330.429034] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 fffe6f9f effff8ef
[ 330.437252] [<c00349f8>] (call_timer_fn) from [<c0035190>] (run_timer_softirq+0x134/0x260)
[ 330.445546] [<c0035190>] (run_timer_softirq) from [<c002f23c>] (__do_softirq+0x138/0x23c)
[ 330.453749] [<c002f23c>] (__do_softirq) from [<c002f5b4>] (irq_exit+0xac/0xf4)
[ 330.461002] [<c002f5b4>] (irq_exit) from [<c000ec04>] (handle_IRQ+0x44/0x90)
[ 330.468080] [<c000ec04>] (handle_IRQ) from [<c00084e0>] (gic_handle_irq+0x2c/0x5c)
[ 330.475680] [<c00084e0>] (gic_handle_irq) from [<c00121c0>] (__irq_svc+0x40/0x50)
[ 330.483175] Exception stack(0xddecff00 to 0xddecff48)
[ 330.488247] ff00: dc37b410 60070013 dc37b410 000009c5 dc37b408 dc375240 ddece000 00000000
[ 330.496442] ff20: 00000001 dc37b410 00000000 00000000 00000000 ddecff48 c0436474 c07519c8
[ 330.504630] ff40: 20070013 ffffffff
[ 330.508156] [<c00121c0>] (__irq_svc) from [<c07519c8>] (_raw_spin_unlock_irqrestore+0x1c/0x20)
[ 330.516801] [<c07519c8>] (_raw_spin_unlock_irqrestore) from [<c0436474>] (mmc_queue_thread+0x12c/0x16c)
[ 330.526225] [<c0436474>] (mmc_queue_thread) from [<c0046bc8>] (kthread+0xd0/0xe8)
[ 330.533735] [<c0046bc8>] (kthread) from [<c000e3c0>] (ret_from_fork+0x14/0x34)
[ 330.540975] Code: bad PC value
[ 330.544053] ---[ end trace 5ea8c90639723bba ]---
[ 330.548685] Kernel panic - not syncing: Fatal exception in interrupt
[ 330.555059] CPU0: stopping
[ 330.557796] CPU: 0 PID: 30 Comm: kworker/0:1 Tainted: G D O 3.14.60+g4386797 #233
[ 330.566005] Workqueue: events od_dbs_timer
[ 330.570166] [<c0014c6c>] (unwind_backtrace) from [<c00116a4>] (show_stack+0x10/0x14)
[ 330.577949] [<c00116a4>] (show_stack) from [<c074c094>] (dump_stack+0x88/0x98)
[ 330.585199] [<c074c094>] (dump_stack) from [<c0013744>] (handle_IPI+0x14c/0x16c)
[ 330.592619] [<c0013744>] (handle_IPI) from [<c000850c>] (gic_handle_irq+0x58/0x5c)
[ 330.600214] [<c000850c>] (gic_handle_irq) from [<c00121c0>] (__irq_svc+0x40/0x50)
[ 330.607710] Exception stack(0xdc1fbcc0 to 0xdc1fbd08)
[ 330.612784] bcc0: 00000004 00000004 c0a0daac 00000003 dc1fbd24 00000001 dc1fbdcc 00000000
[ 330.620982] bce0: c075408c ffffffff 00000000 d83b0b40 00000002 dc1fbd08 c02abeec c00846ac
[ 330.629171] bd00: 000d0113 ffffffff
[ 330.632700] [<c00121c0>] (__irq_svc) from [<c00846ac>] (generic_exec_single+0x50/0xa0)
[ 330.640646] [<c00846ac>] (generic_exec_single) from [<c0084808>] (smp_call_function_single+0x10c/0x19c)
[ 330.650065] [<c0084808>] (smp_call_function_single) from [<c0084c8c>] (on_each_cpu+0x2c/0x48)
[ 330.658617] [<c0084c8c>] (on_each_cpu) from [<c00141b4>] (twd_rate_change+0x28/0x30)
[ 330.666392] [<c00141b4>] (twd_rate_change) from [<c004ad84>] (notifier_call_chain+0x44/0x84)
[ 330.674863] [<c004ad84>] (notifier_call_chain) from [<c004b10c>] (__srcu_notifier_call_chain+0x44/0x60)
[ 330.684285] [<c004b10c>] (__srcu_notifier_call_chain) from [<c004b140>] (srcu_notifier_call_chain+0x18/0x20)
[ 330.694148] [<c004b140>] (srcu_notifier_call_chain) from [<c0474424>] (__clk_notify+0x70/0x78)
[ 330.702790] [<c0474424>] (__clk_notify) from [<c04744c4>] (__clk_recalc_rates+0x98/0x9c)
[ 330.710909] [<c04744c4>] (__clk_recalc_rates) from [<c0474498>] (__clk_recalc_rates+0x6c/0x9c)
Do you have any idea where this problem can come from ?
There are many registers with value 7f7f7f7f (0x7f is actually a char),seems to be caused by overflow of stack or other memory regions.
I am trying to use mpu9250 3 axis accelerometer with imx6 board. I have taken invensense mpu 9265 device driver for Android from here, and successfully compiled the driver with Linux 3.18 kernel as a module (inv_mpu_iio). I have even changed dts file based on my requirement.
I have little knowledge about device trees but after searching I have done following changes to the dts file.
Edited dts file code snippet:
&i2c3 {
extaccelerometer: mpu9265#68{
compatible = "mpu9250";
reg = <0x68>;
interrupt-parent = <&gpio2>;
interrupts = <9>;
};
}
While booting the kernel on to the board I am stuck with the following error:
[ 10.730459] industrialio: module is from the staging directory, the quality is unknown, you have been warned.
[ 10.805020] random: nonblocking pool is initialized
[ 10.819012] kfifo_buf: module is from the staging directory, the quality is unknown, you have been warned.
[....] Waiting for /dev to be fully populated...[ 10.910701] inv_mpu_iio: module is from the staging directory, the quality is unknown, you have been.
[ 10.973279] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 10.981478] pgd = bdeac000
[ 10.984286] [00000000] *pgd=00000000
[ 10.987969] Internal error: Oops: 5 [#1] SMP ARM
[ 10.992628] Modules linked in: inv_mpu_iio(C+) kfifo_buf(C) industrialio(C) sky2
[ 11.000167] CPU: 3 PID: 333 Comm: modprobe Tainted: G C 3.18.0i2c-test+ #1
[ 11.008117] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[ 11.014695] task: bdfc0000 ti: bdd16000 task.ti: bdd16000
[ 11.020179] PC is at inv_mpu_probe+0x70/0xb6c [inv_mpu_iio]
[ 11.025769] LR is at 0x0
[ 11.028318] pc : [<7f029110>] lr : [<00000000>] psr: a0000013
[ 11.028318] sp : bdd17c98 ip : bdc5b484 fp : bdd17cdc
[ 11.039806] r10: 00000000 r9 : 00000004 r8 : 7f02fa34
[ 11.045064] r7 : bdc5b400 r6 : 00000001 r5 : befd7800 r4 : bdc5b000
[ 11.051643] r3 : 00000068 r2 : 00000000 r1 : 0000002f r0 : bdc5b000
[ 11.058250] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 11.065427] Control: 10c5387d Table: 4deac04a DAC: 00000015
[ 11.071241] Process modprobe (pid: 333, stack limit = 0xbdd16238)
[ 11.077417] Stack: (0xbdd17c98 to 0xbdd18000)
[ 11.081848] 7c80: bdd17ccc bdd17ca8
[ 11.090093] 7ca0: 801b0764 801acc5c befd7820 8041d804 befd7820 befd7820 00000000 7f031798
[ 11.098316] 7cc0: befd7800 7f031798 00000004 00000000 bdd17cfc bdd17ce0 8054ad94 7f0290ac
[ 11.106568] 7ce0: 81589ca8 befd7820 80cf1758 00000000 bdd17d34 bdd17d00 8040e504 8054acb4
[ 11.114854] 7d00: 8054ac94 80349964 7f031798 befd7820 7f031798 befd7854 00000000 7f037000
[ 11.123142] 7d20: 8152cc60 00000000 bdd17d54 bdd17d38 8040e7f4 8040e3cc bef307e4 00000000
[ 11.131438] 7d40: 7f031798 8040e750 bdd17d7c bdd17d58 8040c6fc 8040e75c bee18ac0 bef307d8
[ 11.139705] 7d60: be7535e0 7f031798 bdd2b480 80ccc070 bdd17d8c bdd17d80 8040de9c 8040c6a4
[ 11.147932] 7d80: bdd17db4 bdd17d90 8040da60 8040de80 7f030c18 bdd17da0 7f031798 80c76c58
[ 11.156173] 7da0: be7f95c0 80cea230 bdd17dcc bdd17db8 8040f1f0 8040d974 7f031774 80c76c58
[ 11.164408] 7dc0: bdd17de4 bdd17dd0 8054d384 8040f174 80c76c58 80c76c58 bdd17dfc bdd17de8
[ 11.172629] 7de0: 7f037018 8054d354 00000000 80c76c58 bdd17e7c bdd17e00 80008b20 7f03700c
[ 11.180852] 7e00: bdd17e44 bdd17e10 8013b4b4 8077f8a4 00000001 0000084f bdd17e44 000000db
[ 11.189069] 7e20: bdf1b100 c0c70000 00000001 be7f9440 8152cc60 00000001 bdd17e64 bdd17e48
[ 11.197330] 7e40: 801301d0 8013b26c bdd17f48 7f0320d4 7f0320c8 bdd17f48 7f0320d4 7f0320c8
[ 11.205568] 7e60: 80cea230 be7f9440 8152cc60 00000001 bdd17f3c bdd17e80 800a92e0 80008a70
[ 11.213776] 7e80: 7f0320d4 00007fff 800a64e8 bdd17f04 bdd17ebc c0c70000 00000000 c0d14dd8
[ 11.221973] 7ea0: bdd17ed4 76f91d50 00000202 7f0320c8 7f032214 7f032110 8006b448 80a4b86c
[ 11.230166] 7ec0: bdd17fa4 bdd17ed0 800141b0 8006b440 c0d4a000 00000000 00000000 00000000
[ 11.238357] 7ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 11.246548] 7f00: 00000000 00000000 00000000 00000000 20000013 000da17d 76d96000 76f91d50
[ 11.254741] 7f20: 00000080 8000fc44 bdd16000 00000000 bdd17fa4 bdd17f40 800a99e8 800a75e4
[ 11.262935] 7f40: 8000faa4 bdfc0000 c0c70000 000da17d c0d146f8 c0d1455f c0d48a98 0000b758
[ 11.271125] 7f60: 0000cf08 7f031e70 00000019 00000000 0000002c 0000002d 00000016 00000011
[ 11.279319] 7f80: 0000000b 00000000 00000000 00000000 784fb200 784fd698 00000000 bdd17fa8
[ 11.287509] 7fa0: 8000fa80 800a9940 00000000 784fb200 76d96000 000da17d 76f91d50 00000002
[ 11.295699] 7fc0: 00000000 784fb200 784fd698 00000080 00000000 76f91d50 000da17d 00000000
[ 11.303891] 7fe0: 00060000 7e936924 76f8bb07 76f0f264 60000010 76d96000 00000000 00000000
[ 11.312074] Backtrace:
[ 11.314586] [<7f0290a0>] (inv_mpu_probe [inv_mpu_iio]) from [<8054ad94>] (i2c_device_probe+0xec/0x150)
[ 11.323903] r10:00000000 r9:00000004 r8:7f031798 r7:befd7800 r6:7f031798 r5:00000000
[ 11.331840] r4:befd7820
[ 11.334417] [<8054aca8>] (i2c_device_probe) from [<8040e504>] (driver_probe_device+0x144/0x390)
[ 11.343126] r7:00000000 r6:80cf1758 r5:befd7820 r4:81589ca8
[ 11.348882] [<8040e3c0>] (driver_probe_device) from [<8040e7f4>] (__driver_attach+0xa4/0xa8)
[ 11.357328] r10:00000000 r9:8152cc60 r8:7f037000 r7:00000000 r6:befd7854 r5:7f031798
[ 11.365262] r4:befd7820
[ 11.367829] [<8040e750>] (__driver_attach) from [<8040c6fc>] (bus_for_each_dev+0x64/0x98)
[ 11.376017] r6:8040e750 r5:7f031798 r4:00000000 r3:bef307e4
[ 11.381771] [<8040c698>] (bus_for_each_dev) from [<8040de9c>] (driver_attach+0x28/0x30)
[ 11.389783] r6:80ccc070 r5:bdd2b480 r4:7f031798
[ 11.394473] [<8040de74>] (driver_attach) from [<8040da60>] (bus_add_driver+0xf8/0x218)
[ 11.402410] [<8040d968>] (bus_add_driver) from [<8040f1f0>] (driver_register+0x88/0x104)
[ 11.410510] r7:80cea230 r6:be7f95c0 r5:80c76c58 r4:7f031798
[ 11.416264] [<8040f168>] (driver_register) from [<8054d384>] (i2c_register_driver+0x3c/0xfc)
[ 11.424711] r5:80c76c58 r4:7f031774
[ 11.428362] [<8054d348>] (i2c_register_driver) from [<7f037018>] (inv_mpu_init+0x18/0x3c [inv_mpu_iio])
[ 11.437764] r5:80c76c58 r4:80c76c58
[ 11.441414] [<7f037000>] (inv_mpu_init [inv_mpu_iio]) from [<80008b20>] (do_one_initcall+0xbc/0x204)
[ 11.450554] r4:80c76c58 r3:00000000
[ 11.454193] [<80008a64>] (do_one_initcall) from [<800a92e0>] (load_module+0x1d08/0x235c)
[ 11.462294] r10:00000001 r9:8152cc60 r8:be7f9440 r7:80cea230 r6:7f0320c8 r5:7f0320d4
[ 11.470230] r4:bdd17f48
[ 11.472799] [<800a75d8>] (load_module) from [<800a99e8>] (SyS_init_module+0xb4/0x124)
[ 11.480638] r10:00000000 r9:bdd16000 r8:8000fc44 r7:00000080 r6:76f91d50 r5:76d96000
[ 11.488574] r4:000da17d
[ 11.491149] [<800a9934>] (SyS_init_module) from [<8000fa80>] (ret_fast_syscall+0x0/0x48)
[ 11.499247] r6:784fd698 r5:784fb200 r4:00000000
[ 11.503937] Code: e28cc004 e2847b01 e5c435e5 e595e0b4 (e8be000f)
[ 11.510195] ---[ end trace fcf671f516c808ac ]---
udevd[324]: '/sbin/modprobe -b i2c:mpu9250' [333] terminated by signal 11 (Segmentation fault)
As far as I understand, it says segmentation error has occurred during i2c device probe. I am not able to find where I have done a mistake. As I have little knowledge about dts file I am not sure whether I have edited dts file correctly or not. And as far as the driver is concerned, it got compiled correctly so I feel driver should not be an issue here.
Please help me out. I have to finish off this task by this end of this week.
Thank you in advance for your reply.
On a ARM Cortex-A9 (Freescale iMX6SL) running Linux kernel 3.0.35, I am seeing a kernel oops with PC and LR (0x402aca32/0x402ac3cd) that is in user space. Mode is USER_32 and ISA is Thumb. There is no code on this system that executes in Thumb mode.
[ 597.195954] Unable to handle kernel paging request at virtual address 000a34d4
[ 597.205436] pgd = c35dc000
[ 597.208149] [000a34d4] *pgd=8c454831, *pte=8374c1cf, *ppte=8374ca3e
[ 597.214657] Internal error: Oops: 81f [#1] PREEMPT
[ 597.219609] Modules linked in: ...<snip>...
[ 597.243075] CPU: 0 Tainted: P W (3.0.35-aaaaaa #1)
[ 597.249162] PC is at 0x402aca32
[ 597.252304] LR is at 0x402ac3cd
[ 597.255448] pc : [<402aca32>] lr : [<402ac3cd>] psr: 60000030
[ 597.255453] sp : be8fc220 ip : 00000000 fp : 00000809
[ 597.266940] r10: 00000004 r9 : 40336ea0 r8 : 00000818
[ 597.272168] r7 : 4034c25c r6 : 00011b31 r5 : 00001250 r4 : 000a2cc8
[ 597.278698] r3 : 00000000 r2 : 000a34d0 r1 : 00011b30 r0 : 00000809
[ 597.285229] Flags: nZCv IRQs on FIQs on Mode USER_32 ISA Thumb Segment user
[ 597.292629] Control: 10c53c7d Table: 835dc059 DAC: 00000015
[ 597.298378] Process wancontrol (pid: 7551, stack limit = 0xce9f02e8)
[ 597.307890] ---[ end trace f50414d2a3d239df ]---
[ 597.312516] Kernel panic - not syncing: Fatal exception in interrupt
[ 597.325257] Backtrace:
[ 597.327567] [<c0135248>] (dump_backtrace+0x0/0x110) from [<c041e188>] (dump_stack+0x18/0x1c)
[ 597.336837] r6:c3088d20 r5:ce9f02e8 r4:c0537b48 r3:00000002
[ 597.342382] [<c041e170>] (dump_stack+0x0/0x1c) from [<c041e200>] (panic+0x74/0x194)
[ 597.350794] [<c041e18c>] (panic+0x0/0x194) from [<c01355b0>] (die+0x1a4/0x1e4)
[ 597.358402] r3:07ffff00 r2:ce9f1db8 r1:c0537f90 r0:c04ac8ba
[ 597.364044] r7:00000000
[ 597.366591] [<c013540c>] (die+0x0/0x1e4) from [<c013a7b0>] (__do_kernel_fault+0x6c/0x8c)
[ 597.375465] r8:00000000 r7:ce9f1fb0 r6:cee35900 r5:0000081f r4:000a34d4
[ 597.382060] [<c013a744>] (__do_kernel_fault+0x0/0x8c) from [<c013aa90>] (do_page_fault+0x2c0/0x2f0)
[ 597.391760] r8:cee35900 r7:000a34d4 r6:c3088d20 r5:ce9f1fb0 r4:00000001
[ 597.398438] r3:ce9f1fb0
[ 597.400909] [<c013a7d0>] (do_page_fault+0x0/0x2f0) from [<c012c1b8>] (do_DataAbort+0x38/0xa0)
[ 597.410178] [<c012c180>] (do_DataAbort+0x0/0xa0) from [<c0131a88>] (ret_from_exception+0x0/0x10)
[ 597.419298] Exception stack(0xce9f1fb0 to 0xce9f1ff8)
[ 597.424664] 1fa0: 00000809 00011b30 000a34d0 00000000
[ 597.434300] 1fc0: 000a2cc8 00001250 00011b31 4034c25c 00000818 40336ea0 00000004 00000809
[ 597.442488] 1fe0: 00000000 be8fc220 402ac3cd 402aca32 60000030 ffffffff
[ 597.455455] r8:00000818 r7:4034c25c r6:00011b31 r5:0000000f r4:0000040f
If code was executing in user space, it should get SEGV.
void arm_notify_die(const char *str, struct pt_regs *regs,
struct siginfo *info, unsigned long err, unsigned long trap)
{
if (user_mode(regs)) {
current->thread.error_code = err;
current->thread.trap_no = trap;
force_sig_info(info->si_signo, info, current);
} else {
die(str, regs, err);
}
}
Why does it go into die()?
This happens repeatedly with the same backtrace for the same address 0x000a34d4. I can't say the stack has been hosed because the values look the same in different instances of this kernel oops.