提问人:Peterson Yuhala 提问时间:6/12/2023 更新时间:6/12/2023 访问量:75
写入 I2S 寄存器时内核崩溃
Kernel panic when writing to I2S register
问:
我正在为 Jetson AGX Xavier 套件的 I2S 外设编写一个非常简单的测试驱动程序(作为 Linux 内核模块)。从本质上讲,我的测试驱动程序代码在 I2S 基物理地址上执行,并尝试读取特定的偏移量,如下所示:ioremap
#define I2S_BASE 0x2901000 //obtained from DTS below
#define I2S_SIZE 0x100 //obtained from DTS below
void __iomem *i2s_base = ioremap(I2S_BASE, I2S_SIZE);
size_t offset = 0xa0;
unsigned int value = readl(i2s_base + offset);
但是,一旦模块加载了 ,内核就会崩溃并显示紧急消息。下面是错误消息的片段:insmod
Ubuntu 20.04.5 LTS jetson-desktop ttyTCU0
jetson-desktop login: [ 1450.975700] CPU:0, Error: cbb-noc@2300000, irq=15
[ 1450.975880] **************************************
[ 1450.976003] CPU:0, Error:cbb-noc
[ 1450.976082] Error Logger : 0
[ 1450.976188] ErrLog0 : 0x80030000
[ 1450.976257] Transaction Type : RD - Read, Incrementing
[ 1450.976358] Error Code : SLV
[ 1450.976426] Error Source : Target
[ 1450.976497] Error Description : Target error detected by CBB slave
[ 1450.976640] AXI2APB_1 bridge error: SFIFONE - Status FIFO Not Empty interrupt
[ 1450.976779] AXI2APB_1 bridge error: SLV - SLVERR interrupt
[ 1450.976901] Packet header Lock : 0
[ 1450.976971] Packet header Len1 : 3
[ 1450.977043] NOC protocol version : version >= 2.7
[ 1450.977134] ErrLog1 : 0x320028
[ 1450.977201] ErrLog2 : 0x0
[ 1450.977259] RouteId : 0x320028
[ 1450.977337] InitFlow : ccroc_p2ps/I/ccroc_p2ps
[ 1450.977435] Targflow : axis_satellite_grout/T/axis_satellite_grout
[ 1450.977849] TargSubRange : 0
[ 1450.978083] SeqId : 0
[ 1450.978286] ErrLog3 : 0x29010a0
[ 1450.978761] ErrLog4 : 0x0
[ 1450.981398] Address accessed : 0x29010a0
[ 1450.985862] ErrLog5 : 0xa09f851
[ 1450.988923] Non-Modify : 0x1
[ 1450.992347] AXI ID : 0x14
[ 1450.995737] Master ID : CCPLEX
[ 1450.998976] Security Group(GRPSEC): 0x7e
[ 1451.003181] Cache : 0x1 -- Bufferable
[ 1451.007119] Protection : 0x2 -- Unprivileged, Non-Secure, Data Access
[ 1451.013942] FALCONSEC : 0x0
[ 1451.017350] Virtual Queuing Channel(VQC): 0x0
[ 1451.021731] **************************************
[ 1451.027033] kernel BUG at drivers/soc/tegra/cbb/tegra194-cbb.c:2057!
[ 1451.033367] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[ 1451.038702] Modules linked in: i2s_driver_test(OE) fuse(E) lzo_rle(E) lzo_compress(E) zram(E) snd_soc_tegra186_asrc(E) snd_soc_tegra186_dspk(E) snd_soc_tegra210_mvc(E) snd_soc_tegra210_iqc(E) snd_soc_tegra210_admaif(E) snd_soc_tegra210_ope(E) snd_soc_tegra186_arad(E) snd_soc_tegra210_mixer(E) snd_soc_tegra210_afc(E) snd_soc_tegra_pcm(E) snd_soc_tegra210_dmic(E) snd_soc_tegra210_amx(E) snd_soc_tegra210_adx(E) snd_soc_tegra210_i2s(OE) snd_soc_tegra210_sfc(E) input_leds(E) aes_ce_blk(E) crypto_simd(E) cryptd(E) aes_ce_cipher(E) ghash_ce(E) sha2_ce(E) sha256_arm64(E) sha1_ce(E) loop(E) snd_hda_codec_hdmi(E) snd_soc_tegra210_adsp(E) snd_soc_tegra_machine_driver(E) ucsi_ccg(E) snd_soc_rt5659(E) snd_soc_tegra_utils(E) snd_hda_tegra(E) typec_ucsi(E) snd_soc_simple_card_utils(E) snd_soc_spdif_tx(E) max77620_thermal(E) nct1008(E) snd_soc_rl6231(E) typec(E) tegra_bpmp_thermal(E) bluedroid_pm(E) userspace_alert(E) nvadsp(E) snd_hda_codec(E) snd_hda_core(E) ahci(E) snd_soc_tegra210_ahub(E) libahci(E)
[ 1451.038930] tegra210_adma(E) libata(E) spi_tegra114(E) binfmt_misc(E) ina3221(E) pwm_fan(E) nvgpu(E) nvmap(E) ip_tables(E) x_tables(E) [last unloaded: mtd]
[ 1451.139947] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G OE 5.10.104-tegra #3
[ 1451.148336] Hardware name: Unknown Jetson-AGX/Jetson-AGX, BIOS 2.1-32413640 01/24/2023
[ 1451.156481] pstate: 60400089 (nZCv daIf +PAN -UAO -TCO BTYPE=--)
[ 1451.162264] pc : tegra194_cbb_err_isr+0x19c/0x1b0
[ 1451.167239] lr : tegra194_cbb_err_isr+0x11c/0x1b0
[ 1451.171961] sp : ffff8000100039d0
[ 1451.175117] x29: ffff8000100039d0 x28: 0000000000000001
[ 1451.180887] x27: 0000000000000080 x26: ffffa16195213f70
[ 1451.186143] x25: ffffa16195f4ae10 x24: 0000000000000001
[ 1451.191912] x23: ffffa161954f7000 x22: ffffa16195c8ea00
[ 1451.197340] x21: 000000000000000f x20: 0000000000000005
[ 1451.202851] x19: ffffa16195c8e9f0 x18: 0000000000000010
[ 1451.208018] x17: 0000000000000000 x16: 0000000000000000
[ 1451.213530] x15: ffffa161957f2bf0 x14: ffffffffffffffff
[ 1451.219213] x13: ffff8000900035c7 x12: ffff8000100035d0
[ 1451.224548] x11: 0000000000000038 x10: 0101010101010101
[ 1451.229805] x9 : ffff8000100038e0 x8 : 2a2a2a2a2a2a2a2a
[ 1451.235316] x7 : 2a2a2a2a2a2a2a09 x6 : c0000000ffff7fff
[ 1451.240832] x5 : ffff4912bfd1c958 x4 : ffffa16195807968
[ 1451.246511] x3 : 0000000000000001 x2 : ffffa16193cae170
[ 1451.251593] x1 : ffffa161957f2680 x0 : 0000000100010102
[ 1451.256943] Call trace:
[ 1451.259385] tegra194_cbb_err_isr+0x19c/0x1b0
[ 1451.263932] __handle_irq_event_percpu+0x68/0x2a0
[ 1451.268394] handle_irq_event_percpu+0x40/0xa0
[ 1451.272682] handle_irq_event+0x50/0xf0
[ 1451.276445] handle_fasteoi_irq+0xc0/0x170
[ 1451.280470] generic_handle_irq+0x40/0x60
[ 1451.284493] __handle_domain_irq+0x70/0xd0
[ 1451.288716] efi_header_end+0xb0/0xf0
[ 1451.292452] el1_irq+0xd0/0x180
[ 1451.295429] _raw_spin_unlock_irqrestore+0x38/0x70
[ 1451.300161] update_blocked_averages+0x190/0x5b0
[ 1451.304965] _nohz_idle_balance+0x208/0x280
[ 1451.308990] run_rebalance_domains+0x6c/0x80
[ 1451.313276] __do_softirq+0x140/0x3e8
[ 1451.316521] irq_exit+0xc0/0xe0
[ 1451.319926] __handle_domain_irq+0x74/0xd0
[ 1451.323951] efi_header_end+0xcc/0xf0
[ 1451.327450] el1_irq+0xd0/0x180
[ 1451.330516] cpuidle_enter_state+0xb8/0x410
[ 1451.334713] cpuidle_enter+0x40/0x60
[ 1451.338389] call_cpuidle+0x44/0x80
[ 1451.341976] do_idle+0x208/0x270
[ 1451.345406] cpu_startup_entry+0x2c/0x70
[ 1451.349242] rest_init+0xdc/0xe8
[ 1451.352479] arch_call_rest_init+0x18/0x20
[ 1451.356331] start_kernel+0x514/0x54c
[ 1451.360268] Code: a9446bf9 a94573fb a8c67bfd d65f03c0 (d4210000)
[ 1451.366397] ---[ end trace 11078bb0b663f224 ]---
[ 1451.370767] Kernel panic - not syncing: Oops - BUG: Fatal exception in interrupt
[ 1451.378640] SMP: stopping secondary CPUs
[ 1451.382155] Kernel Offset: 0x216183af0000 from 0xffff800010000000
[ 1451.388442] PHYS_OFFSET: 0xffffb6f5c0000000
[ 1451.392814] CPU features: 0x8240002,03802a30
[ 1451.397016] Memory Limit: none
[ 1451.400172] ---[ end Kernel panic - not syncing: Oops - BUG: Fatal exception in interrupt ]---
I2S 基址是从下面的关联设备树节点获取的:
tegra_i2s1: i2s@2901000 {
compatible = "nvidia,tegra194-i2s",
"nvidia,tegra210-i2s";
reg = <0x2901000 0x100>;
clocks = <&bpmp TEGRA194_CLK_I2S1>,
<&bpmp TEGRA194_CLK_I2S1_SYNC_INPUT>;
clock-names = "i2s", "sync_input";
assigned-clocks = <&bpmp TEGRA194_CLK_I2S1>;
assigned-clock-parents = <&bpmp TEGRA194_CLK_PLLA_OUT0>;
assigned-clock-rates = <1536000>;
sound-name-prefix = "I2S1";
status = "disabled";
};
如果有人能提供关于为什么我在每次向 I2S 映射寄存器发出读/写请求时收到内核崩溃的指示,以及可能如何解决这个问题,我将不胜感激。谢谢。
PS:Jetson AGX Xavier 套件的内核已经附带了一个 I2S 驱动程序(非常复杂)。我的测试驱动程序是为研究/教育目的而构建的。
答: 暂无答案
评论